source: FarmatikoData/FarmatikoRepo/HealthcareWorkerRepository.cs@ 4e72684

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

Add more services

  • Property mode set to 100644
File size: 872 bytes
Line 
1using FarmatikoData.FarmatikoRepoInterfaces;
2using FarmatikoData.Models;
3using System.Linq;
4using System.Collections.Generic;
5
6namespace FarmatikoData.FarmatikoRepo
7{
8 public class HealthcareWorkerRepository : IHealthcareWorkerRepository
9 {
10
11 private FarmatikoDataContext _context;
12
13 public HealthcareWorkerRepository(FarmatikoDataContext context)
14 {
15 _context = context;
16 }
17
18 public void Add(HealthcareWorkers HealthcareWorker)
19 {
20 _context.Add(HealthcareWorker);
21 _context.SaveChangesAsync();
22 }
23
24 public IEnumerable<HealthcareWorkers> GetAll()
25 {
26 return _context.HealthcareWorkers.OrderBy(x => x.Name);
27 }
28
29 public void Remove(HealthcareWorkers healthcareWorker)
30 {
31 _context.Remove(healthcareWorker);
32 }
33 }
34}
Note: See TracBrowser for help on using the repository browser.