mirror of https://github.com/abpframework/abp.git
17 changed files with 242 additions and 227 deletions
@ -0,0 +1,11 @@ |
|||||
|
{ |
||||
|
"selectedKubernetesProfile": null, |
||||
|
"solutionRunner": { |
||||
|
"selectedProfile": null, |
||||
|
"targetFrameworks": [], |
||||
|
"applicationsStartingWithoutBuild": [], |
||||
|
"applicationsWithoutAutoRefreshBrowserOnRestart": [], |
||||
|
"applicationBatchStartStates": [], |
||||
|
"folderBatchStartStates": [] |
||||
|
} |
||||
|
} |
||||
@ -1,22 +1,22 @@ |
|||||
using Microsoft.EntityFrameworkCore; |
using Microsoft.EntityFrameworkCore; |
||||
using Volo.Abp.EntityFrameworkCore; |
using Volo.Abp.EntityFrameworkCore; |
||||
using Volo.Abp.Identity.EntityFrameworkCore; |
using Volo.Abp.Identity.EntityFrameworkCore; |
||||
using Volo.Abp.PermissionManagement.EntityFrameworkCore; |
using Volo.Abp.PermissionManagement.EntityFrameworkCore; |
||||
|
|
||||
namespace DempApp.Data; |
namespace DemoApp.Data; |
||||
|
|
||||
public class DempAppDbContext : AbpDbContext<DempAppDbContext> |
public class DemoAppDbContext : AbpDbContext<DemoAppDbContext> |
||||
{ |
{ |
||||
public DempAppDbContext(DbContextOptions<DempAppDbContext> options) |
public DemoAppDbContext(DbContextOptions<DemoAppDbContext> options) |
||||
: base(options) |
: base(options) |
||||
{ |
{ |
||||
} |
} |
||||
|
|
||||
protected override void OnModelCreating(ModelBuilder builder) |
protected override void OnModelCreating(ModelBuilder builder) |
||||
{ |
{ |
||||
base.OnModelCreating(builder); |
base.OnModelCreating(builder); |
||||
|
|
||||
builder.ConfigurePermissionManagement(); |
builder.ConfigurePermissionManagement(); |
||||
builder.ConfigureIdentity(); |
builder.ConfigureIdentity(); |
||||
} |
} |
||||
} |
} |
||||
@ -1,26 +1,26 @@ |
|||||
using Microsoft.EntityFrameworkCore; |
using Microsoft.EntityFrameworkCore; |
||||
using Microsoft.EntityFrameworkCore.Design; |
using Microsoft.EntityFrameworkCore.Design; |
||||
|
|
||||
namespace DempApp.Data; |
namespace DemoApp.Data; |
||||
|
|
||||
public class DempAppDbContextFactory : IDesignTimeDbContextFactory<DempAppDbContext> |
public class DemoAppDbContextFactory : IDesignTimeDbContextFactory<DemoAppDbContext> |
||||
{ |
{ |
||||
public DempAppDbContext CreateDbContext(string[] args) |
public DemoAppDbContext CreateDbContext(string[] args) |
||||
{ |
{ |
||||
var configuration = BuildConfiguration(); |
var configuration = BuildConfiguration(); |
||||
|
|
||||
var builder = new DbContextOptionsBuilder<DempAppDbContext>() |
var builder = new DbContextOptionsBuilder<DemoAppDbContext>() |
||||
.UseSqlServer(configuration.GetConnectionString("Default")); |
.UseSqlServer(configuration.GetConnectionString("Default")); |
||||
|
|
||||
return new DempAppDbContext(builder.Options); |
return new DemoAppDbContext(builder.Options); |
||||
} |
} |
||||
|
|
||||
private static IConfigurationRoot BuildConfiguration() |
private static IConfigurationRoot BuildConfiguration() |
||||
{ |
{ |
||||
var builder = new ConfigurationBuilder() |
var builder = new ConfigurationBuilder() |
||||
.SetBasePath(Directory.GetCurrentDirectory()) |
.SetBasePath(Directory.GetCurrentDirectory()) |
||||
.AddJsonFile("appsettings.json", optional: false); |
.AddJsonFile("appsettings.json", optional: false); |
||||
|
|
||||
return builder.Build(); |
return builder.Build(); |
||||
} |
} |
||||
} |
} |
||||
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"role": "host.mvc" |
||||
|
} |
||||
@ -1,134 +1,134 @@ |
|||||
using DempApp.Data; |
using DemoApp.Data; |
||||
using Microsoft.EntityFrameworkCore; |
using Microsoft.EntityFrameworkCore; |
||||
using Volo.Abp; |
using Volo.Abp; |
||||
using Volo.Abp.Account; |
using Volo.Abp.Account; |
||||
using Volo.Abp.Account.Web; |
using Volo.Abp.Account.Web; |
||||
using Volo.Abp.AspNetCore.Mvc; |
using Volo.Abp.AspNetCore.Mvc; |
||||
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; |
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; |
||||
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; |
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; |
||||
using Volo.Abp.AspNetCore.Serilog; |
using Volo.Abp.AspNetCore.Serilog; |
||||
using Volo.Abp.Autofac; |
using Volo.Abp.Autofac; |
||||
using Volo.Abp.AutoMapper; |
using Volo.Abp.AutoMapper; |
||||
using Volo.Abp.Data; |
using Volo.Abp.Data; |
||||
using Volo.Abp.EntityFrameworkCore; |
using Volo.Abp.EntityFrameworkCore; |
||||
using Volo.Abp.EntityFrameworkCore.SqlServer; |
using Volo.Abp.EntityFrameworkCore.SqlServer; |
||||
using Volo.Abp.Identity; |
using Volo.Abp.Identity; |
||||
using Volo.Abp.Identity.EntityFrameworkCore; |
using Volo.Abp.Identity.EntityFrameworkCore; |
||||
using Volo.Abp.Identity.Web; |
using Volo.Abp.Identity.Web; |
||||
using Volo.Abp.Localization; |
using Volo.Abp.Localization; |
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
using Volo.Abp.MultiTenancy; |
using Volo.Abp.MultiTenancy; |
||||
using Volo.Abp.PermissionManagement; |
using Volo.Abp.PermissionManagement; |
||||
using Volo.Abp.PermissionManagement.EntityFrameworkCore; |
using Volo.Abp.PermissionManagement.EntityFrameworkCore; |
||||
using Volo.Abp.PermissionManagement.HttpApi; |
using Volo.Abp.PermissionManagement.HttpApi; |
||||
using Volo.Abp.PermissionManagement.Identity; |
using Volo.Abp.PermissionManagement.Identity; |
||||
using Volo.Abp.PermissionManagement.Web; |
using Volo.Abp.PermissionManagement.Web; |
||||
using Volo.Abp.Swashbuckle; |
using Volo.Abp.Swashbuckle; |
||||
using Volo.Abp.VirtualFileExplorer.Web; |
using Volo.Abp.VirtualFileExplorer.Web; |
||||
|
|
||||
namespace DempApp; |
namespace DemoApp; |
||||
|
|
||||
[DependsOn( |
[DependsOn( |
||||
// ABP Framework packages
|
// ABP Framework packages
|
||||
typeof(AbpAspNetCoreMvcModule), |
typeof(AbpAspNetCoreMvcModule), |
||||
typeof(AbpAutofacModule), |
typeof(AbpAutofacModule), |
||||
typeof(AbpAutoMapperModule), |
typeof(AbpAutoMapperModule), |
||||
typeof(AbpSwashbuckleModule), |
typeof(AbpSwashbuckleModule), |
||||
typeof(AbpAspNetCoreSerilogModule), |
typeof(AbpAspNetCoreSerilogModule), |
||||
|
|
||||
// basic-theme
|
// basic-theme
|
||||
typeof(AbpAspNetCoreMvcUiBasicThemeModule), |
typeof(AbpAspNetCoreMvcUiBasicThemeModule), |
||||
|
|
||||
// VirtualFileExplorer module packages
|
// VirtualFileExplorer module packages
|
||||
typeof(AbpVirtualFileExplorerWebModule), |
typeof(AbpVirtualFileExplorerWebModule), |
||||
|
|
||||
// Account module packages
|
// Account module packages
|
||||
typeof(AbpAccountWebModule), |
typeof(AbpAccountWebModule), |
||||
typeof(AbpAccountHttpApiModule), |
typeof(AbpAccountHttpApiModule), |
||||
typeof(AbpAccountApplicationModule), |
typeof(AbpAccountApplicationModule), |
||||
|
|
||||
// Identity module packages
|
// Identity module packages
|
||||
typeof(AbpPermissionManagementDomainIdentityModule), |
typeof(AbpPermissionManagementDomainIdentityModule), |
||||
typeof(AbpIdentityWebModule), |
typeof(AbpIdentityWebModule), |
||||
typeof(AbpIdentityHttpApiModule), |
typeof(AbpIdentityHttpApiModule), |
||||
typeof(AbpIdentityApplicationModule), |
typeof(AbpIdentityApplicationModule), |
||||
typeof(AbpIdentityEntityFrameworkCoreModule), |
typeof(AbpIdentityEntityFrameworkCoreModule), |
||||
|
|
||||
// Permission Management module packages
|
// Permission Management module packages
|
||||
typeof(AbpPermissionManagementWebModule), |
typeof(AbpPermissionManagementWebModule), |
||||
typeof(AbpPermissionManagementApplicationModule), |
typeof(AbpPermissionManagementApplicationModule), |
||||
typeof(AbpPermissionManagementHttpApiModule), |
typeof(AbpPermissionManagementHttpApiModule), |
||||
typeof(AbpPermissionManagementEntityFrameworkCoreModule), |
typeof(AbpPermissionManagementEntityFrameworkCoreModule), |
||||
typeof(AbpEntityFrameworkCoreSqlServerModule) |
typeof(AbpEntityFrameworkCoreSqlServerModule) |
||||
)] |
)] |
||||
public class DempAppModule : AbpModule |
public class DemoAppModule : AbpModule |
||||
{ |
{ |
||||
public override void ConfigureServices(ServiceConfigurationContext context) |
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
{ |
{ |
||||
Configure<PermissionManagementOptions>(options => |
Configure<PermissionManagementOptions>(options => |
||||
{ |
{ |
||||
options.SaveStaticPermissionsToDatabase = false; |
options.SaveStaticPermissionsToDatabase = false; |
||||
}); |
}); |
||||
|
|
||||
Configure<AbpMultiTenancyOptions>(options => |
Configure<AbpMultiTenancyOptions>(options => |
||||
{ |
{ |
||||
options.IsEnabled = true; |
options.IsEnabled = true; |
||||
}); |
}); |
||||
|
|
||||
Configure<AbpLocalizationOptions>(options => |
Configure<AbpLocalizationOptions>(options => |
||||
{ |
{ |
||||
options.Languages.Add(new LanguageInfo("en", "en", "English")); |
options.Languages.Add(new LanguageInfo("en", "en", "English")); |
||||
options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); |
options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); |
||||
options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); |
options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); |
||||
}); |
}); |
||||
|
|
||||
context.Services.AddAbpDbContext<DempAppDbContext>(options => |
context.Services.AddAbpDbContext<DemoAppDbContext>(options => |
||||
{ |
{ |
||||
options.AddDefaultRepositories(includeAllEntities: true); |
options.AddDefaultRepositories(includeAllEntities: true); |
||||
}); |
}); |
||||
|
|
||||
Configure<AbpDbContextOptions>(options => |
Configure<AbpDbContextOptions>(options => |
||||
{ |
{ |
||||
options.Configure(configurationContext => |
options.Configure(configurationContext => |
||||
{ |
{ |
||||
configurationContext.UseSqlServer(); |
configurationContext.UseSqlServer(); |
||||
}); |
}); |
||||
}); |
}); |
||||
} |
} |
||||
|
|
||||
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) |
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) |
||||
{ |
{ |
||||
await context.ServiceProvider |
await context.ServiceProvider |
||||
.GetRequiredService<DempAppDbContext>() |
.GetRequiredService<DemoAppDbContext>() |
||||
.Database |
.Database |
||||
.MigrateAsync(); |
.MigrateAsync(); |
||||
|
|
||||
await context.ServiceProvider |
await context.ServiceProvider |
||||
.GetRequiredService<IDataSeeder>() |
.GetRequiredService<IDataSeeder>() |
||||
.SeedAsync(); |
.SeedAsync(); |
||||
|
|
||||
var app = context.GetApplicationBuilder(); |
var app = context.GetApplicationBuilder(); |
||||
var env = context.GetEnvironment(); |
var env = context.GetEnvironment(); |
||||
|
|
||||
if (env.IsDevelopment()) |
if (env.IsDevelopment()) |
||||
{ |
{ |
||||
app.UseDeveloperExceptionPage(); |
app.UseDeveloperExceptionPage(); |
||||
} |
} |
||||
|
|
||||
app.UseAbpRequestLocalization(); |
app.UseAbpRequestLocalization(); |
||||
|
|
||||
if (!env.IsDevelopment()) |
if (!env.IsDevelopment()) |
||||
{ |
{ |
||||
app.UseErrorPage(); |
app.UseErrorPage(); |
||||
} |
} |
||||
|
|
||||
app.MapAbpStaticAssets(); |
app.MapAbpStaticAssets(); |
||||
|
|
||||
app.UseRouting(); |
app.UseRouting(); |
||||
app.UseUnitOfWork(); |
app.UseUnitOfWork(); |
||||
app.UseAuthentication(); |
app.UseAuthentication(); |
||||
app.UseMultiTenancy(); |
app.UseMultiTenancy(); |
||||
app.UseAuthorization(); |
app.UseAuthorization(); |
||||
app.UseConfiguredEndpoints(); |
app.UseConfiguredEndpoints(); |
||||
} |
} |
||||
} |
} |
||||
@ -1,4 +1,4 @@ |
|||||
@page |
@page |
||||
@using Volo.Abp.Users |
@using Volo.Abp.Users |
||||
@model DempApp.Pages.IndexModel |
@model DemoApp.Pages.IndexModel |
||||
@inject ICurrentUser CurrentUser |
@inject ICurrentUser CurrentUser |
||||
|
|||||
@ -1,27 +1,27 @@ |
|||||
{ |
{ |
||||
"iisSettings": { |
"iisSettings": { |
||||
"windowsAuthentication": false, |
"windowsAuthentication": false, |
||||
"anonymousAuthentication": true, |
"anonymousAuthentication": true, |
||||
"iisExpress": { |
"iisExpress": { |
||||
"applicationUrl": "https://localhost:44391/", |
"applicationUrl": "https://localhost:44391/", |
||||
"sslPort": 44391 |
"sslPort": 44391 |
||||
} |
} |
||||
}, |
}, |
||||
"profiles": { |
"profiles": { |
||||
"IIS Express": { |
"IIS Express": { |
||||
"commandName": "IISExpress", |
"commandName": "IISExpress", |
||||
"launchBrowser": true, |
"launchBrowser": true, |
||||
"environmentVariables": { |
"environmentVariables": { |
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
} |
} |
||||
}, |
}, |
||||
"DempApp": { |
"DemoApp": { |
||||
"commandName": "Project", |
"commandName": "Project", |
||||
"launchBrowser": true, |
"launchBrowser": true, |
||||
"environmentVariables": { |
"environmentVariables": { |
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
}, |
}, |
||||
"applicationUrl": "https://localhost:44391/" |
"applicationUrl": "https://localhost:44391/" |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
Loading…
Reference in new issue