Robin Thoni 6b38d93426 README; gitignore; removed lock files | 7 yıl önce | |
---|---|---|
.. | ||
Business | 7 yıl önce | |
Controllers | 7 yıl önce | |
DataAccess | 7 yıl önce | |
Dbo | 7 yıl önce | |
Hubs | 7 yıl önce | |
Interfaces | 7 yıl önce | |
Middlewares | 7 yıl önce | |
Properties | 8 yıl önce | |
Utils | 8 yıl önce | |
Luticate2.Utils.xproj | 8 yıl önce | |
README.md | 7 yıl önce | |
project.json | 7 yıl önce |
NuGet.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="rthoni" value="http://nuget.rthoni.com" protocolVersion="2" />
</packageSources>
</configuration>
project.json
{
...
dependencies": {
"Luticate2.Utils": "0.1.*",
...
}
...
}
appsettings.json
{
...
"ConnectionStrings": {
"default": "User ID=POSTGRES_USER;Password=POSTGRES_PASSWORD;Host=POSTGRES_HOST;Port=5432;Database=POSTGRES_DB;Pooling=true;",
...
}
...
}
Startup.cs
public void ConfigureServices(IServiceCollection services)
{
// ...
// MUST be before addMvc()
services.AddLuticateUtils(options => options.Version = "dev");
// ...
services.AddDbContext<YourDbContext>(options => // Replace YourDbContext with your own database context
{
options.UseNpgsql(Configuration.GetConnectionString("default"));
options.UseInternalServiceProvider(new ServiceCollection()
.AddEntityFrameworkNpgsqlLuticate() // MUST be before AddEntityFrameworkNpgsql()
.AddEntityFrameworkNpgsql()
.BuildServiceProvider());
});
services.AddMvc()
.AddLuticateUtils();
// ...
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
// ...
// MUST be before useMvc()
app.UseLuticateUtils();
// ...
}
See WebApiUtils for an example