static async Task <ConstructionElementSpecification> WriteConstructionElementSpecification(MolioSpecificationFile file, SpecToolDocument specToolDoc) { var specification = file.ConstructionElementSpecifications.Add(new ConstructionElementSpecification { Title = specToolDoc.Name, MolioSpecificationGuid = specToolDoc.Id }); specification.Sections = specToolDoc.Sections .Select(s => SpecSectionToConstructionElementSpecificationSection(s)) .ToList(); await file.SaveChangesAsync(); return(specification); }
static async Task <WorkSpecification> WriteWorkSpecification(MolioSpecificationFile file, SpecToolDocument specToolDoc, string workAreaName, string workAreaId) { var specification = file.WorkSpecifications.Add(new WorkSpecification { WorkAreaName = workAreaName, WorkAreaCode = workAreaId, Key = Guid.NewGuid() }); specification.Sections = specToolDoc.Sections .Select(s => SpecToolSectionToWorkSpecificationSection(s)) .ToList(); await file.SaveChangesAsync(); return(specification); }