public async Task <List <List <string> > > GetCalendarsByProjectId(GetCalendarByProjectIDRequestDTO calendarByProjectIDRequestDTO) { //return new List<Tuple<string, string, DateTime, DateTime>>() //{ // new Tuple<string, string, DateTime, DateTime>("Test 1", "Project A", DateTime.Now, DateTime.Now) //}; List <List <string> > b = new List <List <string> >(); var res = await _cardService.GetCalendarByProjectId(calendarByProjectIDRequestDTO); foreach (var r in res) { List <string> a = new List <string>(); a.Add(r.Estimate.ToString() ?? string.Empty); a.Add(r.Title ?? string.Empty); a.Add(r.Estimate.ToString() ?? string.Empty); a.Add(r.DueDate.ToString() ?? string.Empty); b.Add(a); } return(b); //return await _cardService.GetCalendarByProjectId(calendarByProjectIDRequestDTO); }
public async Task <IEnumerable <GetCalendarByProjectIdResponseDTO> > GetCalendarByProjectId(GetCalendarByProjectIDRequestDTO calendarByProjectIDRequestDTO) { try { return(await _unitOfWokDapper.CardQueries.GetCalendarByProjectId(calendarByProjectIDRequestDTO)); } catch (Exception ex) { _logger.LogExceptionError(ex.ToString()); throw ex; } }
public async Task <IEnumerable <GetCalendarByProjectIdResponseDTO> > GetCalendarByProjectId(GetCalendarByProjectIDRequestDTO calendarByProjectIDRequestDTO) { var query = @$ " SELECT C.* FROM Card C WHERE ProjectId = @ProjectId AND IsActive = @IsActive"; DynamicParameters param = new DynamicParameters(); param.Add("@ProjectId", calendarByProjectIDRequestDTO.ProjectId); param.Add("@IsActive", true); return(await _db.QueryAsync <GetCalendarByProjectIdResponseDTO>(sql : query, param : param, commandType : CommandType.Text)); }
public async Task <IEnumerable <GetCalendarByProjectIdResponseDTO> > GetCalendarByProjectId(GetCalendarByProjectIDRequestDTO calendarByProjectIDRequestDTO) { return(await _cardService.GetCalendarByProjectId(calendarByProjectIDRequestDTO)); }