コード例 #1
0
        public void Add(PolicyModel entity)
        {
            MapperHelper <Policy, PolicyModel> utils = new MapperHelper <Policy, PolicyModel>();

            var dbEntity = _context.Set <Policy>().Add(utils.setValues((Policy)Activator.CreateInstance(typeof(Policy)), entity));

            _context.SaveChanges();
        }
コード例 #2
0
        public void Add(CustomerModel entity)
        {
            MapperHelper <Customer, CustomerModel> utils = new MapperHelper <Customer, CustomerModel>();

            var dbEntity = _context.Set <Customer>().Add(utils.setValues((Customer)Activator.CreateInstance(typeof(Customer)), entity));

            _context.SaveChanges();
        }