public async Task CheckValidityAsync(CallContext context) { QueryValidationHelper.CheckNotReservedGuid(CurrentUserId); QueryValidationHelper.CheckNotReservedGuid(CardId); await QueryValidationHelper.CheckCardExistsAsync(context.DbContext, CardId); CardVisibilityHelper.CheckUserIsAllowedToViewCards(context.DbContext, CurrentUserId, CardId); }
public async Task CheckValidityAsync(CallContext callContext) { await QueryValidationHelper.CheckUserExistsAsync(callContext.DbContext, UserId); await QueryValidationHelper.CheckCardExistsAsync(callContext.DbContext, CardId); if (Rating < 1 || Rating > 5) { throw new RequestInputException($"Invalid rating: {Rating}"); } }