public async Task <long> GetNewImportNumber(GetImportNumberRequest request) { var newImportNumber = new ImportNumber { Comment = request.Comment, Priority = request.Priority, Type = (LabelingType)request.Type }; await importRepository.AddAsync(newImportNumber); if (request.AssignedLabels == null) { return(newImportNumber.Id); } var assignedImports = request.AssignedLabels.Select(item => new AssignedLabelGroups { ImportNumber = newImportNumber.Id, LabelGroupId = item }).ToArray(); await assignedLabelGroupsRepository.AddRangeAsync(assignedImports); return(newImportNumber.Id); }
public Task UpdateAsync(ImportNumber import) { importNumberDataSet.Update(import); return(dbContext.SaveChangesAsync()); }
public Task AddAsync(ImportNumber newImport) { importNumberDataSet.Add(newImport); return(dbContext.SaveChangesAsync()); }