fix DbSeeder Items in appSettings and enable Seeding items using Generics ...
This commit is contained in:
+23
-5
@@ -6,6 +6,7 @@ using IdentityModel.AspNetCore.OAuth2Introspection;
|
|||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
@@ -103,9 +104,24 @@ namespace xApi
|
|||||||
x.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
|
x.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
|
||||||
});
|
});
|
||||||
|
|
||||||
// //
|
//
|
||||||
// // Check Data Service ...
|
// Custom ...
|
||||||
// var dataServiceConfig = Configuration.GetXDataServiceConfiguration();
|
|
||||||
|
//
|
||||||
|
services.Configure<IISServerOptions>(options =>
|
||||||
|
{
|
||||||
|
options.AllowSynchronousIO = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
//
|
||||||
|
services.Configure<KestrelServerOptions>(options =>
|
||||||
|
{
|
||||||
|
options.AllowSynchronousIO = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check Data Service ...
|
||||||
|
var dataServiceConfig = Configuration.GetXDataServiceConfiguration();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check DataBase Registration ...
|
// Check DataBase Registration ...
|
||||||
@@ -165,8 +181,10 @@ namespace xApi
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Use xDataService Middleware ...
|
// Use xDataService Middleware ...
|
||||||
// TODO: Fix this ...
|
app.UseXDatabase(
|
||||||
// app.UseXDatabase(apiDatabaseDescriptor);
|
descriptor: apiDatabaseDescriptor,
|
||||||
|
isDevelopmentEnvironment: env.IsDevelopment()
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Using Services ...
|
// Using Services ...
|
||||||
|
|||||||
+14
-1
@@ -54,12 +54,25 @@
|
|||||||
"Databases": {
|
"Databases": {
|
||||||
"xApiDb": {
|
"xApiDb": {
|
||||||
"Provider": "SQLITE",
|
"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,
|
"EnableTracking": true,
|
||||||
"EnableSoftDelete": false,
|
"EnableSoftDelete": false,
|
||||||
"EnableDetailedErrors": false,
|
"EnableDetailedErrors": false,
|
||||||
|
"SeedingMode": "AddIfNotExists",
|
||||||
"EnableSensitiveDataLogging": true,
|
"EnableSensitiveDataLogging": true,
|
||||||
"PagingConfiguration": {
|
"PagingConfiguration": {
|
||||||
"DefaultPageSize": 20,
|
"DefaultPageSize": 20,
|
||||||
|
|||||||
Reference in New Issue
Block a user