Blame view

src/MapsDb/DataService/SurfaceTreatmentDs.cs 853 Bytes
ddeb0c63   Administrator   add RoadSurfaceCo...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  using MapsDb.Interfaces;
  using MapsDb.Models;
  using MapsModels.DsModels;
  namespace MapsDb.DataService
  {
      public class SurfaceTreatmentDs : ISurfaceTreatmentDs
      {
          private PostgresDbContext _context;
          public SurfaceTreatmentDs(){
              _context = new PostgresDbContext();
          }
          public Task<IList<SurfaceTreatmentSelectListDsM>> GetSelectListAsync(){
              return Task.Factory.StartNew(GetSelectList);
          }
          private IList<SurfaceTreatmentSelectListDsM> GetSelectList()
          {
             return _context.SurfaceTreatment.Select(x => new SurfaceTreatmentSelectListDsM
              {
                  SurfaceTreatmentId = x.SurfaceTreatmentId, 
                  Name = x.Name
              }).ToList();
          }
  
      }
  }