Example #1
0
 /// <summary>
 /// レスポンスの結果を取得
 /// </summary>
 public T GetResult <T>(BacklogResponse <T> res) where T : BacklogItem
 {
     if (res.IsSuccess)
     {
         return(res.Content);
     }
     Debug.LogError(string.Join(", ", res.Errors.Select(x => x.Message)));
     return(null);
 }
Example #2
0
        public BacklogResponse GetTeamBacklog(BacklogRequest request)
        {
            var response = new BacklogResponse();

            RunCode(MethodBase.GetCurrentMethod().Name, request, response, (uow) =>
            {
                _manager.GetTeamBacklog(request, response);
            });
            return(response);
        }
Example #3
0
        public void GetTeamBacklog(BacklogRequest request, BacklogResponse response)
        {
            var teamBacklog = _uow.Repository <BacklogEntity>().GetOverview().Where(b => b.TeamId == request.TeamId).FirstOrDefault();

            if (teamBacklog != null)
            {
                var xRefBacklogTask = _uow.Repository <XRefBacklogTaskEntity>().GetOverview().Where(x => x.BacklogId == teamBacklog.BacklogId).Select(i => i.TaskId);
                var tasks           = _uow.Repository <TaskEntity>().GetOverview().Where(t => xRefBacklogTask.Contains(t.Id)).OrderBy(t => t.OrderId).ThenByDescending(t => t.Id);
                if (tasks != null)
                {
                    response.Tasks = _mapper.Map <List <TaskVM> >(tasks);
                }
            }
            else
            {
                response.Errors.Add("Get Tasks", "Cannot featch Tasks");
            }
        }
Example #4
0
        public static bool CanContinueBatchJobs <T>(this BacklogResponse <T> response, ErrorHandler onError)
        {
            if (response.IsSuccess)
            {
                return(true);
            }

            if (onError == null || !response.Errors.Any())
            {
                return(true);
            }

            foreach (var error in response.Errors)
            {
                if (!onError(error))
                {
                    return(false);
                }
            }

            return(true);
        }
Example #5
0
 /// <summary>
 /// トランザクション系のエラーで失敗しているかチェック
 /// </summary>
 public bool CheckIsRetry <T>(BacklogResponse <T> res)
 {
     return(!res.IsSuccess && res.Errors.Any(x => x.Message.StartsWith("Deadlock")));
 }