public GDRepository(GoodGood_DBContext context) { if (context == null) { throw new ArgumentException(); } _context = context; }
public HomeRepository(GoodGood_DBContext context, IConfiguration config) { _context = context; if (string.IsNullOrEmpty(connString)) { connString = config.GetConnectionString("GoodGood_DBContext"); } if (conn == null) { conn = new SqlConnection(connString); } }