コード例 #1
0
ファイル: ReaderProvider.cs プロジェクト: JeremiePr/todolist
        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);
        }
コード例 #2
0
ファイル: ReaderProvider.cs プロジェクト: JeremiePr/todolist
        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);
        }
コード例 #3
0
ファイル: WriterProvider.cs プロジェクト: JeremiePr/todolist
 public WriterProvider(TodoListContext context, IDateTimeWrapper dateTimeWrapper)
 {
     _context         = context;
     _mapperConfig    = EntityMapping.GetMapperConfig();
     _dateTimeWrapper = dateTimeWrapper;
 }
コード例 #4
0
ファイル: ReaderProvider.cs プロジェクト: JeremiePr/todolist
 public ReaderProvider(TodoListContext context)
 {
     _context      = context;
     _mapperConfig = EntityMapping.GetMapperConfig();
 }