source: Farmatiko/Controllers/MedicineController.cs@ a55ef91

Last change on this file since a55ef91 was a55ef91, checked in by DimitarSlezenkovski <dslezenkovski@…>, 2 years ago

Update & add service

  • Property mode set to 100644
File size: 1.2 KB
Line 
1using System.Linq;
2using FarmatikoData.Models;
3using FarmatikoServices.FarmatikoServiceInterfaces;
4using Microsoft.AspNetCore.Mvc;
5
6namespace 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]
18 public IQueryable<Medicine> Get()
19 {
20 return _medicineService.GetAll();
21 }
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 }*/
42 }
43}
Note: See TracBrowser for help on using the repository browser.