コード例 #1
0
        public async Task <bool> ValidateId(Profession Profession)
        {
            ProfessionFilter ProfessionFilter = new ProfessionFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = Profession.Id
                },
                Selects = ProfessionSelect.Id
            };

            int count = await UOW.ProfessionRepository.Count(ProfessionFilter);

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