public PrivateCustomerView(PrivateCustomer model)
        {
            Mapper.CreateMap<PrivateCustomer, PrivateCustomerView>();
            Mapper.Map<PrivateCustomer, PrivateCustomerView>(model, this);

            this.created = model.created.ToString().Replace('T', ' ');
            this.updated = model.updated.ToString().Replace('T', ' ');
        }
Exemple #2
0
        public PrivateCustomerView(PrivateCustomer model)
        {
            Mapper.CreateMap <PrivateCustomer, PrivateCustomerView>();
            Mapper.Map <PrivateCustomer, PrivateCustomerView>(model, this);

            this.created = model.created.ToString().Replace('T', ' ');
            this.updated = model.updated.ToString().Replace('T', ' ');
        }
        public PrivateCustomer getModel()
        {
            var model = new PrivateCustomer();

            Mapper.CreateMap<PrivateCustomerView, PrivateCustomer>().ForSourceMember(x => x.type, y => y.Ignore());
            Mapper.Map<PrivateCustomerView, PrivateCustomer>(this, model);

            return model;
        }
Exemple #4
0
        public PrivateCustomer getModel()
        {
            var model = new PrivateCustomer();

            Mapper.CreateMap <PrivateCustomerView, PrivateCustomer>().ForSourceMember(x => x.type, y => y.Ignore());
            Mapper.Map <PrivateCustomerView, PrivateCustomer>(this, model);

            return(model);
        }
 public PrivateCustomer createPrivateCustomer(PrivateCustomer model)
 {
     db.privateCustomers.Add(model);
     db.SaveChanges();
     return model;
 }