Fixed the constraint issue with Metadata and ensure we log parameters on development modes. (#273)
This commit is contained in:
parent
ee3cb9ede8
commit
f0f74e867e
4 changed files with 11 additions and 3 deletions
|
@ -4,16 +4,18 @@ using API.Interfaces;
|
|||
using API.Interfaces.Services;
|
||||
using API.Services;
|
||||
using API.Services.Tasks;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace API.Extensions
|
||||
{
|
||||
public static class ApplicationServiceExtensions
|
||||
{
|
||||
public static IServiceCollection AddApplicationServices(this IServiceCollection services, IConfiguration config)
|
||||
public static IServiceCollection AddApplicationServices(this IServiceCollection services, IConfiguration config, IWebHostEnvironment env)
|
||||
{
|
||||
services.AddAutoMapper(typeof(AutoMapperProfiles).Assembly);
|
||||
services.AddScoped<ITaskScheduler, TaskScheduler>();
|
||||
|
@ -32,6 +34,7 @@ namespace API.Extensions
|
|||
services.AddDbContext<DataContext>(options =>
|
||||
{
|
||||
options.UseSqlite(config.GetConnectionString("DefaultConnection"));
|
||||
options.EnableSensitiveDataLogging(env.IsDevelopment());
|
||||
});
|
||||
|
||||
services.AddLogging(loggingBuilder =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue