public Store_StoreDeliveryTimeDTO(StoreDeliveryTime StoreDeliveryTime)
 {
     this.Id     = StoreDeliveryTime.Id;
     this.Code   = StoreDeliveryTime.Code;
     this.Name   = StoreDeliveryTime.Name;
     this.Errors = StoreDeliveryTime.Errors;
 }
 public async Task <bool> Delete(StoreDeliveryTime StoreDeliveryTime)
 {
     if (await ValidateId(StoreDeliveryTime))
     {
     }
     return(StoreDeliveryTime.IsValidated);
 }
        public async Task <StoreDeliveryTime> Get(long Id)
        {
            StoreDeliveryTime StoreDeliveryTime = await UOW.StoreDeliveryTimeRepository.Get(Id);

            if (StoreDeliveryTime == null)
            {
                return(null);
            }
            return(StoreDeliveryTime);
        }
        public async Task <StoreDeliveryTime> Get(long Id)
        {
            StoreDeliveryTime StoreDeliveryTime = await DataContext.StoreDeliveryTime.AsNoTracking()
                                                  .Where(x => x.Id == Id)
                                                  .Select(x => new StoreDeliveryTime()
            {
                Id   = x.Id,
                Code = x.Code,
                Name = x.Name,
            }).FirstOrDefaultAsync();

            if (StoreDeliveryTime == null)
            {
                return(null);
            }

            return(StoreDeliveryTime);
        }
        public async Task <bool> ValidateId(StoreDeliveryTime StoreDeliveryTime)
        {
            StoreDeliveryTimeFilter StoreDeliveryTimeFilter = new StoreDeliveryTimeFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = StoreDeliveryTime.Id
                },
                Selects = StoreDeliveryTimeSelect.Id
            };

            int count = await UOW.StoreDeliveryTimeRepository.Count(StoreDeliveryTimeFilter);

            if (count == 0)
            {
                StoreDeliveryTime.AddError(nameof(StoreDeliveryTimeValidator), nameof(StoreDeliveryTime.Id), ErrorCode.IdNotExisted);
            }
            return(count == 1);
        }
 public async Task <bool> Create(StoreDeliveryTime StoreDeliveryTime)
 {
     return(StoreDeliveryTime.IsValidated);
 }