public async Task <bool> ValidateId(Discount Discount) { DiscountFilter DiscountFilter = new DiscountFilter { Skip = 0, Take = 10, Id = new LongFilter { Equal = Discount.Id }, Selects = DiscountSelect.Id }; int count = await UOW.DiscountRepository.Count(DiscountFilter); if (count == 0) { Discount.AddError(nameof(DiscountValidator), nameof(Discount.Id), ErrorCode.IdNotExisted); } return(count == 1); }