diff --git a/Startup.cs b/Startup.cs index 429b04a..4bd0cdb 100644 --- a/Startup.cs +++ b/Startup.cs @@ -6,6 +6,7 @@ using IdentityModel.AspNetCore.OAuth2Introspection; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -103,9 +104,24 @@ namespace xApi x.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); }); - // // - // // Check Data Service ... - // var dataServiceConfig = Configuration.GetXDataServiceConfiguration(); + // + // Custom ... + + // + services.Configure(options => + { + options.AllowSynchronousIO = true; + }); + + // + services.Configure(options => + { + options.AllowSynchronousIO = true; + }); + + // + // Check Data Service ... + var dataServiceConfig = Configuration.GetXDataServiceConfiguration(); // // Check DataBase Registration ... @@ -165,8 +181,10 @@ namespace xApi // // Use xDataService Middleware ... - // TODO: Fix this ... - // app.UseXDatabase(apiDatabaseDescriptor); + app.UseXDatabase( + descriptor: apiDatabaseDescriptor, + isDevelopmentEnvironment: env.IsDevelopment() + ); // // Using Services ... diff --git a/appsettings.json b/appsettings.json index b1e3be7..de6af52 100644 --- a/appsettings.json +++ b/appsettings.json @@ -54,12 +54,25 @@ "Databases": { "xApiDb": { "Provider": "SQLITE", - "ConnectionString": "Filename=./Db/XApi.db" + "ConnectionString": "Filename=./Db/XApi.db", + "SeedItems": { + "XTest": [ + { + "Firstname": "Hadi", + "Lastname": "Khazaee Asl" + }, + { + "Firstname": "Amir Ali", + "Lastname": "Khazaee Asl" + } + ] + } } }, "EnableTracking": true, "EnableSoftDelete": false, "EnableDetailedErrors": false, + "SeedingMode": "AddIfNotExists", "EnableSensitiveDataLogging": true, "PagingConfiguration": { "DefaultPageSize": 20,