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(); }
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(); }