コード例 #1
0
ファイル: ToDoController.cs プロジェクト: Cycapb/ToDoList
        public async Task <IHttpActionResult> GetToDoList(int id)
        {
            var item = (await _valueProvider.GetValuesAsync())?
                       .Where(x => x.NoteId == id)
                       .Select(x => new TodoListDto()
            {
                NoteId    = x.NoteId,
                Comment   = x.Comment,
                GroupName = x.Group.Name,
                Name      = x.Name,
                StatusId  = x.StatusId,
            })
                       .SingleOrDefault();

            if (item == null)
            {
                return(NotFound());
            }
            return(Ok(item));
        }
コード例 #2
0
 public async Task <IQueryable <GroupDto> > GetValues(string userId)
 {
     return((await _valueProvider.GetValuesAsync())?
            .Where(x => x.UserId == userId)
            .Select(x => new GroupDto()
     {
         UserId = x.UserId,
         GroupId = x.GroupId,
         Name = x.Name
     }));
 }