public async Task <int> CreateAsync(int datasetId, RecordCreation recordCreation) { var userId = await GetUserIdAsync(); var entity = _mapper.Create(recordCreation); await InvokeGuard(() => _guard.AgainstInvalidRecordCreationAsync(userId, datasetId, recordCreation)); await _repository.AddRecordAsync(datasetId, entity); await _unitOfWork.SaveChangesAsync(); return(entity.Id); }