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