public async Task <ObjectiveDTO> GetOneObjective(int objectiveId) { var query = from x in _context.Objectives where x.Id == objectiveId select x; var objective = await query .ProjectTo <ObjectiveDTO>(EntityMapping.GetMapperConfig()) .SingleOrDefaultAsync(); return(objective); }
public async Task <IEnumerable <ObjectiveDTO> > GetObjectives(StatusTypes?statusType) { var query = from x in _context.Objectives where !statusType.HasValue || x.StatusTypeKey == (int)statusType.Value orderby x.Priority descending, x.LastUpdateDate ascending select x; var objectives = await query .ProjectTo <ObjectiveDTO>(EntityMapping.GetMapperConfig()) .ToListAsync(); return(objectives); }
public WriterProvider(TodoListContext context, IDateTimeWrapper dateTimeWrapper) { _context = context; _mapperConfig = EntityMapping.GetMapperConfig(); _dateTimeWrapper = dateTimeWrapper; }
public ReaderProvider(TodoListContext context) { _context = context; _mapperConfig = EntityMapping.GetMapperConfig(); }