Esempio n. 1
0
        public override void Restore()
        {
            MuntinType original = Original as MuntinType;

            if (original == null)
            {
                throw new InvalidOperationException(
                          "View model does not have an original value.");
            }
            Id          = original.Id;
            Name        = original.Name;
            Width       = original.Width;
            Weight      = original.Weight;
            Height      = original.Height;
            Price       = original.Price;
            Tolerance   = original.Tolerance;
            Description = original.Description;
        }
Esempio n. 2
0
        public static MuntinType ToModel(this MuntinTypeViewModel muntinTypeViewModel)
        {
            if (muntinTypeViewModel == null)
            {
                throw new ArgumentNullException("muntinTypeViewModel");
            }
            MuntinType muntinType = new MuntinType();

            muntinType.Id          = muntinTypeViewModel.Id;
            muntinType.Name        = muntinTypeViewModel.Name;
            muntinType.Width       = muntinTypeViewModel.Width;
            muntinType.Weight      = muntinTypeViewModel.Weight;
            muntinType.Height      = muntinTypeViewModel.Height;
            muntinType.Price       = muntinTypeViewModel.Price;
            muntinType.Description = muntinTypeViewModel.Description;
            muntinType.Tolerance   = muntinTypeViewModel.Tolerance;
            return(muntinType);
        }
Esempio n. 3
0
 public MuntinTypeViewModel(MuntinType muntinType)
 {
     Original = muntinType;
     Restore();
 }