示例#1
0
 public static async Task CreateMissionList(string listName, Guid projectId)
 {
     using (var missionListSvc = new MissionListService())
     {
         var list = missionListSvc.GetAll(m => m.ProjectId == projectId).ToList();
         await missionListSvc.CreateAsync(new MissionList()
         {
             ListName  = listName,
             ProjectId = projectId,
             Order     = list.Count() + 1,
         }, true);
     }
 }
示例#2
0
        public static List <MissionListDto> GetMissionListByProjectId(Guid projectId)
        {
            using (var missionListSvc = new MissionListService())
            {
                var list = missionListSvc.GetAll(m => m.ProjectId == projectId).Select(m => new MissionListDto()
                {
                    Id       = m.Id,
                    ListName = m.ListName,
                    Order    = m.Order,
                }).ToList();

                foreach (var missionList in list)
                {
                    var missions = GetMissionByListId(missionList.Id);
                    missionList.Missions = missions;
                }
                return(list);
            }
        }