/// <summary> /// Добавить доклад (основная информация). /// </summary> public async Task <Guid> InsertAsync(ReportInnerModel innerModel) { var report = _mapper.Map <Report>(innerModel); report.Id = Guid.NewGuid(); report.Path = String.Empty; await _db.InsertAsync(report); await InsertCollaboratorsAsync(report.Id, innerModel.Collaborators); return(report.Id); }
public async Task AttachUserAsync(Guid reportId, string email) { var user = await _userRepository.GetByEmailAsync(email); await _db.InsertAsync( new Collaborator { ReportId = reportId, UserId = user.Id }); }
public async Task <Guid> InsertAsync(User user) { user.Id = Guid.NewGuid(); user.Phone ??= string.Empty; await _db.InsertAsync(user); return(user.Id); }