Mise en place de la structure définitive du CRUD et modification de la page principale avec les datas
This commit is contained in:
13
Controllers/DBConnectionController.cs
Normal file
13
Controllers/DBConnectionController.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Data.SqlClient;
|
||||
|
||||
public class DBConnectionController : Controller
|
||||
{
|
||||
protected SqlConnection GetConnection()
|
||||
{
|
||||
var connectionString = AppSettings.GetConnectionString("DefaultConnection");
|
||||
var connection = new SqlConnection(connectionString);
|
||||
connection.Open();
|
||||
return connection;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user