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 RoadCategoryDs : IRoadCategoryDs { private PostgresDbContext _context; public RoadCategoryDs(){ _context = new PostgresDbContext(); } public Task> GetSelectListAsync(){ return Task.Factory.StartNew(GetSelectList); } private IList GetSelectList() { return _context.RoadCategory.Select(x => new RoadCategorySelectListDsM { RoadCategoryId = x.RoadCategoryId, Value = x.Value }).ToList(); } } }