Changeset 6f203af for Farmatiko/Controllers/FarmatikoController.cs
- Timestamp:
- 10/28/20 22:06:48 (4 years ago)
- Branches:
- master
- Children:
- 993189e
- Parents:
- 1454207
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/Controllers/FarmatikoController.cs
r1454207 r6f203af 1 using System. Linq;1 using System.Collections.Generic; 2 2 using System.Threading.Tasks; 3 3 using FarmatikoData.Models; … … 8 8 { 9 9 [ApiController] 10 [Route("api/[action]")]11 10 public class FarmatikoController : Controller 12 11 { … … 19 18 //Get 20 19 [HttpGet] 21 [Route(" /api/workers")]22 public async Task<I Queryable<HealthcareWorker>> GetWorkers()20 [Route("api/workers")] 21 public async Task<IEnumerable<HealthcareWorker>> GetWorkers() 23 22 { 24 23 var Workers = await _service.GetAllWorkers(); … … 26 25 } 27 26 [HttpGet] 28 [Route(" /api/workers/search/{Query}")]29 public async Task<I Queryable<HealthcareWorker>> SearchWorkers(string Query)27 [Route("api/workers/search/{Query}")] 28 public async Task<IEnumerable<HealthcareWorker>> SearchWorkers(string Query) 30 29 { 31 30 return await _service.SearchWorkers(Query); 32 31 } 33 32 [HttpGet] 34 [Route(" /api/workers/{id}")]33 [Route("api/workers/{id}")] 35 34 public async Task<HealthcareWorker> GetWorker(int Id) 36 35 { … … 43 42 //Get 44 43 [HttpGet] 45 [Route(" /api/facilities")]46 public async Task<I Queryable<HealthFacility>> GetFacilities()44 [Route("api/facilities")] 45 public async Task<IEnumerable<HealthFacility>> GetFacilities() 47 46 { 48 47 return await _service.GetFacilities(); 49 48 } 50 49 [HttpGet] 51 [Route(" /api/facilities/search/{Query}")]52 public async Task<I Queryable<HealthFacility>> SearchFacilities(string Query)50 [Route("api/facilities/search/{Query}")] 51 public async Task<IEnumerable<HealthFacility>> SearchFacilities(string Query) 53 52 { 54 53 return await _service.SearchFacilities(Query); 55 54 } 56 55 [HttpGet] 57 [Route(" /api/facilities/{Id}")]56 [Route("api/facilities/{Id}")] 58 57 public async Task<HealthFacility> GetFacility(int Id) 59 58 { … … 65 64 //Get 66 65 [HttpGet] 67 [Route(" /api/medicines")]68 public async Task<I Queryable<Medicine>> GetMedicines()66 [Route("api/medicines")] 67 public async Task<IEnumerable<Medicine>> GetMedicines() 69 68 { 70 69 return await _service.GetMedicines(); 71 70 } 72 71 [HttpGet] 73 [Route(" /api/medicines/search/{Query}")]74 public async Task<I Queryable<Medicine>> SearchMedicines(string Query)72 [Route("api/medicines/search/{Query}")] 73 public async Task<IEnumerable<Medicine>> SearchMedicines(string Query) 75 74 { 76 75 return await _service.SearchMedicines(Query); 77 76 } 78 77 [HttpGet] 79 [Route(" /api/medicines/{Id}")]78 [Route("api/medicines/{Id}")] 80 79 public async Task<Medicine> GetMedicine(int Id) 81 80 { 82 81 return await _service.GetMedicine(Id); 83 82 } 84 //POST85 86 83 //Pandemic 87 84 [HttpGet] 88 [Route(" /api/pandemic")]85 [Route("api/pandemic")] 89 86 public async Task<Pandemic> GetPandemic() 90 87 { … … 94 91 //GET 95 92 [HttpGet] 96 [Route(" /api/pharmacy")]97 public async Task<I Queryable<Pharmacy>> GetPharmacies()93 [Route("api/pharmacy")] 94 public async Task<IEnumerable<Pharmacy>> GetPharmacies() 98 95 { 99 96 return await _service.GetPharmacies(); 100 97 } 101 98 [HttpGet] 102 [Route(" /api/pharmacy/search/{Query}")]103 public async Task<I Queryable<Pharmacy>> SearchPharmacies(string Query)99 [Route("api/pharmacy/search/{Query}")] 100 public async Task<IEnumerable<Pharmacy>> SearchPharmacies(string Query) 104 101 { 105 102 return await _service.SearchPharmacies(Query); 106 103 } 107 104 [HttpGet] 108 [Route(" /api/pharmacy/{Id}")]105 [Route("api/pharmacy/{Id}")] 109 106 public async Task<Pharmacy> GetPharmacy(int Id) 110 107 {
Note:
See TracChangeset
for help on using the changeset viewer.