public async Task <bool> ValidateId(EntityReference EntityReference) { EntityReferenceFilter EntityReferenceFilter = new EntityReferenceFilter { Skip = 0, Take = 10, Id = new IdFilter { Equal = EntityReference.Id }, Selects = EntityReferenceSelect.Id }; int count = await UOW.EntityReferenceRepository.Count(EntityReferenceFilter); if (count == 0) { EntityReference.AddError(nameof(EntityReferenceValidator), nameof(EntityReference.Id), ErrorCode.IdNotExisted); } return(count == 1); }