https://github.com/shiftkey/desktop
https://gist.github.com/berkorbay/6feda478a00b0432d13f1fc0a50467f1
https://github.com/shiftkey/desktop
https://gist.github.com/berkorbay/6feda478a00b0432d13f1fc0a50467f1
- installer le package Microsoft.EntityFrameworkCore.Proxies
- dans le dbcontext
private readonly string _connexionString;
public SqlServerContext(string connexionString)
{
_connexionString = connexionString;
}
- dans le dbcontext.OnConfiguring
string myConnectionString = "data source=(LocalDB)\\MSSQLLocalDB;attachdbfilename=C:\\ADI\\DEV_LORO\\CSHARP\\SLN_FACTURE2018\\DATABASE\\FACTURE.MDF;integrated security=True;connect timeout=30;";
optionsBuilder
.UseLazyLoadingProxies()
.UseSqlServer(myConnectionString);
et commenter le reste
https://docs.microsoft.com/en-us/ef/core/querying/related-data/lazy