public async Task CreateMarksForSubject(int id, IEnumerable <Mark> marks) { var marksWithIdentity = marks.Select(mark => { if (mark.Id == 0) { _markIdentityAssignService.AssignIdentity(mark); } return(mark); }).ToList(); await UpdateMarksForSubject(id, marksWithIdentity).ConfigureAwait(false); }
public async Task Create(Student entity) { _identityAssignService.AssignIdentity(entity); await _mongoCollection.InsertOneAsync(entity).ConfigureAwait(false); }