public async Task <bool> ValidateId(PaymentMethod PaymentMethod) { PaymentMethodFilter PaymentMethodFilter = new PaymentMethodFilter { Skip = 0, Take = 10, Id = new LongFilter { Equal = PaymentMethod.Id }, Selects = PaymentMethodSelect.Id }; int count = await UOW.PaymentMethodRepository.Count(PaymentMethodFilter); if (count == 0) { PaymentMethod.AddError(nameof(PaymentMethodValidator), nameof(PaymentMethod.Id), ErrorCode.IdNotExisted); } return(count == 1); }