Ignore:
Timestamp:
07/29/20 13:21:48 (4 years ago)
Author:
DimitarSlezenkovski <dslezenkovski@…>
Branches:
master
Children:
de18858
Parents:
ef1219a
Message:

Add more services

Location:
Farmatiko/Controllers
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • Farmatiko/Controllers/HealthFacilitiesController.cs

    ref1219a re42f61a  
    11using FarmatikoData;
    22using FarmatikoData.Models;
     3using Microsoft.AspNetCore.Cors;
    34using Microsoft.AspNetCore.Mvc;
    45using System.Collections.Generic;
     
    2021            return _healthFacilitiesService.GetAll();
    2122        }
    22         [HttpGet]
    23         public IEnumerable<HealthFacilities> GetByName(string Name)
    24         {
    25             return _healthFacilitiesService.GetByName(Name);
    26         }
    27        
    28         [HttpGet]
    29         public IEnumerable<HealthFacilities> GetByType(string Type)
    30         {
    31             return _healthFacilitiesService.GetByType(Type);
    32         }
    33         [HttpPut]
    34         public void Add(HealthFacilities healthFacility)
    35         {
    36             _healthFacilitiesService.Add(healthFacility);
    37         }
    3823    }
    3924}
  • Farmatiko/Controllers/HealthcareWorkerController.cs

    ref1219a re42f61a  
    1 using Microsoft.AspNetCore.Mvc;
    2 using FarmatikoData.FarmatikoServiceInterfaces;
     1using System;
    32using System.Collections.Generic;
     3using System.Linq;
     4using System.Threading.Tasks;
    45using FarmatikoData.Models;
     6using FarmatikoServices.FarmatikoServiceInterfaces;
     7using Microsoft.AspNetCore.Mvc;
    58
    69namespace Farmatiko.Controllers
    710{
     11    [ApiController]
     12    [Route("[controller]/[action]")]
    813    public class HealthcareWorkerController : Controller
    914    {
     
    1520
    1621        [HttpGet]
    17         public IEnumerable<HealthcareWorkers> GetAll()
     22        public IEnumerable<HealthcareWorkers> Get()
    1823        {
    1924            return _healthcareWorkerService.GetAll();
    2025        }
    21         [HttpGet]
    22         public HealthcareWorkers GetByName(string Name)
    23         {
    24             return _healthcareWorkerService.GetByName(Name);
    25         }
    26         [HttpGet]
    27         public IEnumerable<HealthcareWorkers> GetAllByBranch(string Branch)
    28         {
    29             return _healthcareWorkerService.GetAllByBranch(Branch);
    30         }
    31         [HttpGet]
    32         public IEnumerable<HealthcareWorkers> GetAllByFacility(HealthFacilities Facility)
    33         {
    34             return _healthcareWorkerService.GetAllByFacility(Facility);
    35         }
    36         [HttpGet]
    37         public void Add(HealthcareWorkers HealthcareWorker)
    38         {
    39             _healthcareWorkerService.Add(HealthcareWorker);
    40         }
     26
    4127    }
    4228}
Note: See TracChangeset for help on using the changeset viewer.