예제 #1
0
        public async Task <bool> ValidateId(Tracking Tracking)
        {
            TrackingFilter TrackingFilter = new TrackingFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = Tracking.Id
                },
                Selects = TrackingSelect.Id
            };

            int count = await UOW.TrackingRepository.Count(TrackingFilter);

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