Blame view

src/MapsDb/DataService/DepartmentAffiliationDs.cs 898 Bytes
27918c1f   Administrator   add service object
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  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 DepartmentAffiliationDs : IDepartmentAffiliationDs
      {
          private PostgresDbContext _context;
          public DepartmentAffiliationDs(){
              _context = new PostgresDbContext();
          }
e02ee314   Administrator   add update and cr...
15
          public Task<IList<DepartmentAffiliationSelectListDsM>> GetSelectListAsync(){
27918c1f   Administrator   add service object
16
17
              return Task.Factory.StartNew(GetSelectList);
          }
e02ee314   Administrator   add update and cr...
18
          private IList<DepartmentAffiliationSelectListDsM> GetSelectList()
27918c1f   Administrator   add service object
19
          {
e02ee314   Administrator   add update and cr...
20
             return _context.DepartmentAffiliation.Select(x => new DepartmentAffiliationSelectListDsM
27918c1f   Administrator   add service object
21
22
23
24
25
26
27
28
              {
                  DepartmentAffiliationId = x.DepartmentAffiliationId, 
                  Name = x.Name
              }).ToList();
          }
  
      }
  }