Example #1
0
 public EpicEntityBuilder()
 {
     _epicEntity = new EpicEntity
     {
         Id                = "Default Epic",
         Name              = "Name",
         CapabilityId      = Guid.NewGuid(),
         SourceUrl         = "url",
         CompliancyLevelId = (int)CompliancyLevel.May,
         Active            = false
     };
 }
Example #2
0
        public async Task Create(string name, string description, DateTime deadline, List <int> taskIds)
        {
            var epic = new EpicEntity
            {
                Deadline    = deadline,
                Description = description,
                Name        = name
            };

            taskIds.ForEach(x => epic.Tasks.Add(new TaskEntity {
                Id = x
            }));

            this.dbContext.Epics.Add(epic);

            await this.dbContext.SaveChangesAsync();
        }
        public static async Task GivenSolutionsAreLinkedToEpics(Table table)
        {
            var epics = (await EpicEntity.FetchAllAsync()).ToDictionary(e => e.Id);

            foreach (var solutionEpicTable in table.CreateSet <SolutionClaimedEpicTable>().Where(set => set.EpicIds.Any()))
            {
                if (!Enum.TryParse(solutionEpicTable.Status, out SolutionEpicEntityBuilder.SolutionEpicStatus status))
                {
                    status = SolutionEpicEntityBuilder.SolutionEpicStatus.Passed;
                }

                foreach (var epicId in solutionEpicTable.EpicIds)
                {
                    await SolutionEpicEntityBuilder.Create()
                    .WithSolutionId(solutionEpicTable.SolutionId)
                    .WithCapabilityId(epics[epicId].CapabilityId)
                    .WithEpicId(epicId)
                    .WithStatus(status)
                    .Build()
                    .InsertAsync();
                }
            }
        }
 private static async Task InsertEpicAsync(EpicEntity epicEntity)
 {
     await epicEntity.InsertAsync();
 }