public bool Add(RegisterCustomerModel model) { RegisterCustomerEntity entity = AutoMapperHelper.DoMap <RegisterCustomerModel, RegisterCustomerEntity>(model); entity.CreateDate = DateTime.Now; entity.UpdateDate = DateTime.Now; return(_registerCustomerDal.Inster(entity) > 0); }
public int Inster(RegisterCustomerEntity entity) { using (BrightourDbContext db = new BrightourDbContext()) { var log = db.RegisterCustomer.Add(entity); db.SaveChanges(); return(log.Id); } }