public async Task <UserPhoto> CreateAsync(UserPhoto userPhoto) { if (userPhoto == null) { throw new ArgumentNullException(nameof(userPhoto)); } if (userPhoto.Id > 0) { throw new ArgumentOutOfRangeException(nameof(userPhoto.Id)); } var result = await _userPhotoRepository.InsertUpdateAsync(userPhoto); if (result != null) { CancelTokens(result); } return(result); }