Exemplo n.º 1
0
        public async Task <bool> ValidateId(Organization Organization)
        {
            OrganizationFilter OrganizationFilter = new OrganizationFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = Organization.Id
                },
                Selects = OrganizationSelect.Id
            };

            int count = await UOW.OrganizationRepository.Count(OrganizationFilter);

            if (count == 0)
            {
                Organization.AddError(nameof(OrganizationValidator), nameof(Organization.Id), ErrorCode.IdNotExisted);
            }
            return(count == 1);
        }