Last change
on this file since c406ae5 was c406ae5, checked in by DimitarSlezenkovski <dslezenkovski@…>, 5 years ago |
Update Models, Repos, Services and Controllers
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | using System.Linq;
|
---|
2 | using System.Threading.Tasks;
|
---|
3 | using FarmatikoData.Models;
|
---|
4 | using FarmatikoServices.FarmatikoServiceInterfaces;
|
---|
5 | using Microsoft.AspNetCore.Mvc;
|
---|
6 |
|
---|
7 | namespace Farmatiko.Controllers
|
---|
8 | {
|
---|
9 | [ApiController]
|
---|
10 | [Route("[controller]/[action]")]
|
---|
11 | public class MedicineController : Controller
|
---|
12 | {
|
---|
13 | private IMedicineService _medicineService;
|
---|
14 | public MedicineController(IMedicineService medicineService)
|
---|
15 | {
|
---|
16 | _medicineService = medicineService;
|
---|
17 | }
|
---|
18 | [HttpGet]
|
---|
19 | public Task<IQueryable<Medicine>> Get()
|
---|
20 | {
|
---|
21 | return _medicineService.GetAll();
|
---|
22 | }
|
---|
23 | /*[HttpPost]
|
---|
24 | public void Add(Medicine medicine)
|
---|
25 | {
|
---|
26 | _medicineService.Add(medicine);
|
---|
27 | }
|
---|
28 | [HttpPost]
|
---|
29 | public void Remove(string Medicine)
|
---|
30 | {
|
---|
31 | _medicineService.Remove(Medicine);
|
---|
32 | }
|
---|
33 | [HttpGet]
|
---|
34 | public IQueryable<Medicine> GetByName(string Name)
|
---|
35 | {
|
---|
36 | return _medicineService.GetByName(Name);
|
---|
37 | }
|
---|
38 | [HttpGet]
|
---|
39 | public IQueryable<Medicine> GetByManufacturer(string Manufacturer)
|
---|
40 | {
|
---|
41 | return _medicineService.GetByManufacturer(Manufacturer);
|
---|
42 | }*/
|
---|
43 | }
|
---|
44 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.