Ejemplo n.º 1
0
 public async Task CheckValidityAsync(CallContext callContext)
 {
     QueryValidationHelper.CheckNotReservedGuid(CurrentUserId);
     QueryValidationHelper.CheckNotReservedGuid(DeckId);
     QueryValidationHelper.CheckNotReservedGuid(CardId);
     await QueryValidationHelper.CheckUserIsOwnerOfDeckAsync(callContext.DbContext, CurrentUserId, DeckId);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
            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);
            }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
            public async Task CheckValidityAsync(CallContext callContext)
            {
                await QueryValidationHelper.CheckCanCreateDeckAsync(UserId, Name, HeapingAlgorithmId, callContext.DbContext, callContext.Localized);

                await QueryValidationHelper.CheckUserIsOwnerOfDeckAsync(callContext.DbContext, UserId, DeckId);
            }
Ejemplo n.º 7
0
            public async Task CheckValidityAsync(MemCheckDbContext dbContext)
            {
                await QueryValidationHelper.CheckUserExistsAsync(dbContext, UserId);

                await QueryValidationHelper.CheckUserIsOwnerOfDeckAsync(dbContext, UserId, DeckId);
            }
Ejemplo n.º 8
0
 public async Task CheckValidityAsync(CallContext callContext)
 {
     await QueryValidationHelper.CheckUserIsOwnerOfDeckAsync(callContext.DbContext, UserId, DeckId);
 }