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

            int count = await UOW.PositionRepository.Count(PositionFilter);

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