Esempio n. 1
0
        public CarWashToClientShortModel ToModel(CarWashFullEntity?entity)
        {
            if (entity == null)
            {
                throw new Exception(ExceptionMessage.EmptyResponse);
            }

            Id       = entity.Id;
            Name     = entity.Name;
            Location = entity.Location;
            IsOpen   = CarWashWorkingHoursExtensions.IsCarWashOpen(entity);
            return(this);
        }
Esempio n. 2
0
        public CarWashToClientFullModel ToModel(CarWashFullEntity?entity)
        {
            if (entity == null)
            {
                throw new Exception(ExceptionMessage.EmptyResponse);
            }

            Id             = entity.Id;
            Name           = entity.Name;
            Email          = entity.Email;
            Phone          = entity.Phone;
            Location       = entity.Location;
            CoordinateX    = entity.CoordinateX;
            CoordinateY    = entity.CoordinateY;
            Description    = entity.Description;
            HasCafe        = entity.HasCafe;
            HasRestZone    = entity.HasRestZone;
            HasParking     = entity.HasParking;
            HasWC          = entity.HasWC;
            HasCardPayment = entity.HasCardPayment;
            WorkingHours   = new CarWashWorkingHoursModel().ToModel(entity);
            IsOpen         = CarWashWorkingHoursExtensions.IsCarWashOpen(entity);
            return(this);
        }