source: FarmatikoData/FarmatikoRepo/HealthFacilityRepository.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: 807 bytes
Line 
1using FarmatikoData.FarmatikoRepoInterfaces;
2using System;
3using System.Linq;
4using System.Collections.Generic;
5using System.Text;
6using FarmatikoData.Models;
7using Microsoft.EntityFrameworkCore;
8
9namespace FarmatikoData.FarmatikoRepo
10{
11 public class HealthFacilityRepository : IHealthFacilityRepository
12 {
13 private FarmatikoDataContext _context;
14
15 public HealthFacilityRepository(FarmatikoDataContext context)
16 {
17 _context = context;
18 }
19
20 public void Add(HealthFacilities healthFacility)
21 {
22 _context.Add(healthFacility);
23 _context.SaveChangesAsync();
24 }
25
26 public IEnumerable<HealthFacilities> GetAll()
27 {
28 return _context.HealthFacilities.OrderBy(x => x.Name).ToList();
29 }
30
31 }
32}
Note: See TracBrowser for help on using the repository browser.