public async Task CheckValidityAsync(CallContext callContext) { QueryValidationHelper.CheckNotReservedGuid(CurrentUserId); QueryValidationHelper.CheckNotReservedGuid(DeckId); QueryValidationHelper.CheckNotReservedGuid(CardId); await QueryValidationHelper.CheckUserIsOwnerOfDeckAsync(callContext.DbContext, CurrentUserId, DeckId); }
public async Task CheckValidityAsync(CallContext callContext) { QueryValidationHelper.CheckNotReservedGuid(DeckId); if (TargetHeap < CardInDeck.UnknownHeap || TargetHeap > CardInDeck.MaxHeapValue) { throw new InvalidOperationException($"Invalid target heap {TargetHeap}"); } await QueryValidationHelper.CheckUserIsOwnerOfDeckAsync(callContext.DbContext, UserId, DeckId); }
public async Task CheckValidityAsync(CallContext callContext) { if (QueryValidationHelper.IsReservedGuid(UserId)) { throw new InvalidOperationException("Invalid user ID"); } await QueryValidationHelper.CheckUserIsOwnerOfDeckAsync(callContext.DbContext, UserId, DeckId); CardVisibilityHelper.CheckUserIsAllowedToViewCards(callContext.DbContext, UserId, CardIds); }
public async Task CheckValidityAsync(CallContext callContext) { QueryValidationHelper.CheckNotReservedGuid(CurrentUserId); QueryValidationHelper.CheckNotReservedGuid(DeckId); QueryValidationHelper.CheckContainsNoReservedGuid(ExcludedCardIds); QueryValidationHelper.CheckContainsNoReservedGuid(ExcludedTagIds); if (CardsToDownload < 1 || CardsToDownload > 100) { throw new RequestInputException($"Invalid CardsToDownload: {CardsToDownload}"); } await QueryValidationHelper.CheckUserIsOwnerOfDeckAsync(callContext.DbContext, CurrentUserId, DeckId); }
public async Task CheckValidityAsync(CallContext callContext) { if (QueryValidationHelper.IsReservedGuid(CurrentUserId)) { throw new RequestInputException($"Invalid user id '{CurrentUserId}'"); } if (QueryValidationHelper.IsReservedGuid(DeckId)) { throw new RequestInputException($"Invalid deck id '{DeckId}'"); } if (ExcludedCardIds.Any(cardId => QueryValidationHelper.IsReservedGuid(cardId))) { throw new RequestInputException($"Invalid card id"); } if (ExcludedTagIds.Any(cardId => QueryValidationHelper.IsReservedGuid(cardId))) { throw new RequestInputException($"Invalid tag id"); } if (CardsToDownload < 1 || CardsToDownload > 100) { throw new RequestInputException($"Invalid CardsToDownload: {CardsToDownload}"); } await QueryValidationHelper.CheckUserIsOwnerOfDeckAsync(callContext.DbContext, CurrentUserId, DeckId); }
public async Task CheckValidityAsync(CallContext callContext) { await QueryValidationHelper.CheckCanCreateDeckAsync(UserId, Name, HeapingAlgorithmId, callContext.DbContext, callContext.Localized); await QueryValidationHelper.CheckUserIsOwnerOfDeckAsync(callContext.DbContext, UserId, DeckId); }
public async Task CheckValidityAsync(MemCheckDbContext dbContext) { await QueryValidationHelper.CheckUserExistsAsync(dbContext, UserId); await QueryValidationHelper.CheckUserIsOwnerOfDeckAsync(dbContext, UserId, DeckId); }
public async Task CheckValidityAsync(CallContext callContext) { await QueryValidationHelper.CheckUserIsOwnerOfDeckAsync(callContext.DbContext, UserId, DeckId); }