source: Farmatiko/Controllers/PharmacyHeadController.cs@ 63d885e

Last change on this file since 63d885e was c406ae5, checked in by DimitarSlezenkovski <dslezenkovski@…>, 4 years ago

Update Models, Repos, Services and Controllers

  • Property mode set to 100644
File size: 1.4 KB
Line 
1using System.Linq;
2using FarmatikoData.FarmatikoRepoInterfaces;
3using FarmatikoData.Models;
4using Microsoft.AspNetCore.Mvc;
5
6namespace Farmatiko.Controllers
7{
8 [ApiController]
9 [Route("[controller]/[action]")]
10 public class PharmacyHeadController : Controller
11 {
12 private IPharmacyHeadRepository _pharmacyHeadRepository;
13 public PharmacyHeadController(IPharmacyHeadRepository pharmacyHeadRepository)
14 {
15 _pharmacyHeadRepository = pharmacyHeadRepository;
16 }
17 [HttpGet]
18 public IQueryable<PharmacyHead> GetAllPharmacies(string NameOfPharmacy)
19 {
20 return _pharmacyHeadRepository.GetAllPharmacies(NameOfPharmacy);
21 }
22 [HttpGet]
23 public IQueryable<PharmacyHead> GetPharmacyByName(string Name)
24 {
25 return _pharmacyHeadRepository.GetPharmacyByName(Name);
26 }
27 [HttpGet]
28 public IQueryable<MedicineList> GetPharmacyMedicines(string NameOfPharmacy)
29 {
30 return _pharmacyHeadRepository.GetPharmacyMedicines(NameOfPharmacy);
31 }
32 [HttpPost]
33 public void Add(PharmacyHead pharmacyHead)
34 {
35 _pharmacyHeadRepository.Add(pharmacyHead);
36 }
37 [HttpPost]
38 public void Remove(PharmacyHead pharmacyHead)
39 {
40 _pharmacyHeadRepository.Remove(pharmacyHead);
41 }
42 }
43}
Note: See TracBrowser for help on using the repository browser.