Last change
on this file since de18858 was e42f61a, checked in by DimitarSlezenkovski <dslezenkovski@…>, 4 years ago |
Add more services
|
-
Property mode
set to
100644
|
File size:
872 bytes
|
Line | |
---|
1 | using FarmatikoData.FarmatikoRepoInterfaces;
|
---|
2 | using FarmatikoData.Models;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Collections.Generic;
|
---|
5 |
|
---|
6 | namespace 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.