예제 #1
0
            public async Task CheckValidityAsync(CallContext context)
            {
                QueryValidationHelper.CheckNotReservedGuid(CurrentUserId);
                QueryValidationHelper.CheckNotReservedGuid(CardId);
                await QueryValidationHelper.CheckCardExistsAsync(context.DbContext, CardId);

                CardVisibilityHelper.CheckUserIsAllowedToViewCards(context.DbContext, CurrentUserId, CardId);
            }
예제 #2
0
            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}");
                }
            }