mirror of https://github.com/abpframework/abp.git
committed by
GitHub
1073 changed files with 186667 additions and 543 deletions
@ -0,0 +1,27 @@ |
|||
{ |
|||
"iisSettings": { |
|||
"windowsAuthentication": false, |
|||
"anonymousAuthentication": true, |
|||
"iisExpress": { |
|||
"applicationUrl": "http://localhost:57333/", |
|||
"sslPort": 0 |
|||
} |
|||
}, |
|||
"profiles": { |
|||
"IIS Express": { |
|||
"commandName": "IISExpress", |
|||
"launchBrowser": true, |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
}, |
|||
"Volo.Abp.AspNetCore.Mvc.UI.Dashboards": { |
|||
"commandName": "Project", |
|||
"launchBrowser": true, |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
}, |
|||
"applicationUrl": "http://localhost:57343/" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
|||
|
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssemblyName>Volo.Abp.AspNetCore.Mvc.UI.Dashboards</AssemblyName> |
|||
<PackageId>Volo.Abp.AspNetCore.Mvc.UI.Dashboards</PackageId> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<IsPackable>true</IsPackable> |
|||
<OutputType>Library</OutputType> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<EmbeddedResource Include="Volo\Abp\AspNetCore\Mvc\UI\Dashboards\Components\**\*.cshtml" /> |
|||
<Content Remove="Volo\Abp\AspNetCore\Mvc\UI\Dashboards\Components\**\*.cshtml" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Content Remove="Volo\Abp\AspNetCore\Mvc\UI\Dashboards\_ViewImports.cshtml" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<EmbeddedResource Include="Volo\Abp\AspNetCore\Mvc\UI\Dashboards\_ViewImports.cshtml" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Widgets\Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Bundling\Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj" /> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,20 @@ |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.VirtualFileSystem; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpAspNetCoreMvcUiWidgetsModule) |
|||
)] |
|||
public class AbpAspNetCoreMvcUiDashboardsModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<VirtualFileSystemOptions>(options => |
|||
{ |
|||
options.FileSets.AddEmbedded<AbpAspNetCoreMvcUiDashboardsModule>(); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards |
|||
{ |
|||
public class AbpBasicDashboardScriptContributor : BundleContributor |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards |
|||
{ |
|||
public class AbpBasicDashboardStyleContributor : BundleContributor |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.Options; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards.Components.Dashboard |
|||
{ |
|||
public class DashboardViewComponent : AbpViewComponent |
|||
{ |
|||
private readonly DashboardOptions _dashboardOptions; |
|||
private readonly WidgetOptions _widgetOptions; |
|||
|
|||
public DashboardViewComponent(IOptions<DashboardOptions> dashboardOptions, IOptions<WidgetOptions> widgetOptions) |
|||
{ |
|||
_dashboardOptions = dashboardOptions.Value; |
|||
_widgetOptions = widgetOptions.Value; |
|||
} |
|||
|
|||
public IViewComponentResult Invoke(string dashboardName) |
|||
{ |
|||
var dashboard = _dashboardOptions.Dashboards.Single(d => d.Name.Equals(dashboardName)); |
|||
|
|||
var model = new DashboardViewModel(dashboard, _widgetOptions.Widgets); |
|||
|
|||
return View("~/Volo/Abp/AspNetCore/Mvc/UI/Dashboards/Components/Dashboard/Default.cshtml", model); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards.Components.Dashboard |
|||
{ |
|||
public class DashboardViewModel |
|||
{ |
|||
public DashboardDefinition Dashboard { get; set; } |
|||
|
|||
public List<WidgetDefinition> Widgets { get; set; } |
|||
|
|||
public DashboardViewModel(DashboardDefinition dashboard, List<WidgetDefinition> widgets) |
|||
{ |
|||
Dashboard = dashboard; |
|||
Widgets = widgets; |
|||
} |
|||
|
|||
public WidgetDefinition GetWidget(string name) |
|||
{ |
|||
return Widgets.Single(d => d.Name.Equals(name)); |
|||
} |
|||
|
|||
public async Task<bool> CheckPermissionsAsync(IAuthorizationService authorizationService, WidgetDefinition widget) |
|||
{ |
|||
foreach (var permission in widget.RequiredPermissions) |
|||
{ |
|||
if (!await authorizationService.IsGrantedAsync(permission)) |
|||
{ |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
@using Microsoft.AspNetCore.Authorization |
|||
@using Microsoft.Extensions.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Widgets |
|||
@inject IAuthorizationService AuthorizationService |
|||
@inject IWidgetRenderer WidgetRenderer |
|||
@inject IStringLocalizerFactory localizer |
|||
@model Volo.Abp.AspNetCore.Mvc.UI.Dashboards.Components.Dashboard.DashboardViewModel |
|||
@{ |
|||
} |
|||
|
|||
<abp-row> |
|||
@foreach (var widgetConfiguration in Model.Dashboard.AvailableWidgets) |
|||
{ |
|||
var widgetDefinition = Model.GetWidget(widgetConfiguration.WidgetName); |
|||
if (await Model.CheckPermissionsAsync(AuthorizationService, widgetDefinition)) |
|||
{ |
|||
widgetDefinition.DefaultDimensions = widgetConfiguration.Dimensions ?? widgetDefinition.DefaultDimensions ?? new WidgetDimensions(6, 4); |
|||
|
|||
<abp-column class="col-@(widgetDefinition.DefaultDimensions.Width) p-2" |
|||
style="height: @(widgetDefinition.DefaultDimensions.Height * 100)px"> |
|||
|
|||
@await WidgetRenderer.RenderAsync(Component, widgetDefinition.Name) |
|||
</abp-column> |
|||
} |
|||
} |
|||
</abp-row> |
|||
@ -0,0 +1,49 @@ |
|||
using System.Collections.Generic; |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards |
|||
{ |
|||
public class DashboardDefinition |
|||
{ |
|||
/// <summary>
|
|||
/// Unique name of the dashboard.
|
|||
/// </summary>
|
|||
[NotNull] |
|||
public string Name { get; } |
|||
|
|||
/// <summary>
|
|||
/// A list of Widgets available for this dashboard.
|
|||
/// </summary>
|
|||
public List<DashboardWidgetConfiguration> AvailableWidgets { get; } |
|||
|
|||
/// <summary>
|
|||
/// Display name of the widget.
|
|||
/// </summary>
|
|||
[NotNull] |
|||
public ILocalizableString DisplayName |
|||
{ |
|||
get => _displayName; |
|||
set => _displayName = Check.NotNull(value, nameof(value)); |
|||
} |
|||
private ILocalizableString _displayName; |
|||
|
|||
public DashboardDefinition( |
|||
[NotNull] string name, |
|||
[CanBeNull] ILocalizableString displayName) |
|||
{ |
|||
Name = Check.NotNullOrWhiteSpace(name, nameof(name)); |
|||
DisplayName = displayName ?? new FixedLocalizableString(name); |
|||
|
|||
AvailableWidgets = new List<DashboardWidgetConfiguration>(); |
|||
} |
|||
|
|||
public DashboardDefinition WithWidget(string widgetName, WidgetLocation location = null, WidgetDimensions dimensions = null) |
|||
{ |
|||
AvailableWidgets.Add( new DashboardWidgetConfiguration(widgetName, dimensions, location)); |
|||
|
|||
return this; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards |
|||
{ |
|||
public class DashboardOptions |
|||
{ |
|||
public List<DashboardDefinition> Dashboards { get; } |
|||
|
|||
public DashboardOptions() |
|||
{ |
|||
Dashboards = new List<DashboardDefinition>(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Html; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Dashboards.Components.Dashboard; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards |
|||
{ |
|||
public class DashboardRenderer : IDashboardRenderer |
|||
{ |
|||
public async Task<IHtmlContent> RenderAsync(IViewComponentHelper componentHelper, object args = null) |
|||
{ |
|||
return await componentHelper.InvokeAsync(typeof(DashboardViewComponent), args ?? new object()); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards |
|||
{ |
|||
public class DashboardWidgetConfiguration |
|||
{ |
|||
[NotNull] |
|||
public string WidgetName { get; } |
|||
|
|||
[CanBeNull] |
|||
public WidgetDimensions Dimensions { get; set; } |
|||
|
|||
[CanBeNull] |
|||
public WidgetLocation Location { get; set; } |
|||
|
|||
public DashboardWidgetConfiguration( |
|||
[NotNull] string widgetName, |
|||
[CanBeNull] WidgetDimensions dimensions = null, |
|||
[CanBeNull] WidgetLocation location = null |
|||
) |
|||
{ |
|||
WidgetName = Check.NotNullOrWhiteSpace(widgetName, nameof(widgetName)); |
|||
Dimensions = dimensions; |
|||
Location = location; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Html; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards |
|||
{ |
|||
public interface IDashboardRenderer : ITransientDependency |
|||
{ |
|||
Task<IHtmlContent> RenderAsync(IViewComponentHelper componentHelper, object args = null); |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards |
|||
{ |
|||
public class WidgetLocation |
|||
{ |
|||
public int X { get; set; } |
|||
|
|||
public int Y { get; set; } |
|||
|
|||
public WidgetLocation(int x, int y) |
|||
{ |
|||
X = x; |
|||
Y = y; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
|||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap |
|||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling |
|||
@ -0,0 +1,16 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssemblyName>Volo.Abp.AspNetCore.Mvc.UI.Widgets</AssemblyName> |
|||
<PackageId>Volo.Abp.AspNetCore.Mvc.UI.Widgets</PackageId> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,13 @@ |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpAspNetCoreMvcUiBootstrapModule) |
|||
)] |
|||
public class AbpAspNetCoreMvcUiWidgetsModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Html; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets |
|||
{ |
|||
public interface IWidgetRenderer : ITransientDependency |
|||
{ |
|||
Task<IHtmlContent> RenderAsync(IViewComponentHelper componentHelper, string widgetName, object args = null); |
|||
} |
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets |
|||
{ |
|||
public class WidgetDefinition |
|||
{ |
|||
/// <summary>
|
|||
/// Unique name of the widget.
|
|||
/// </summary>
|
|||
[NotNull] |
|||
public string Name { get; } |
|||
|
|||
/// <summary>
|
|||
/// Display name of the widget.
|
|||
/// </summary>
|
|||
[NotNull] |
|||
public ILocalizableString DisplayName |
|||
{ |
|||
get => _displayName; |
|||
set => _displayName = Check.NotNull(value, nameof(value)); |
|||
} |
|||
private ILocalizableString _displayName; |
|||
|
|||
[NotNull] |
|||
public Type ViewComponentType { get; } |
|||
|
|||
[CanBeNull] |
|||
public WidgetDimensions DefaultDimensions { get; set; } |
|||
|
|||
public List<string> RequiredPermissions { get; set; } |
|||
|
|||
public WidgetDefinition( |
|||
[NotNull] string name, |
|||
[CanBeNull] ILocalizableString displayName, |
|||
[NotNull] Type viewComponentType) |
|||
{ |
|||
Name = Check.NotNullOrWhiteSpace(name, nameof(name)); |
|||
ViewComponentType = Check.NotNull(viewComponentType, nameof(viewComponentType)); |
|||
DisplayName = displayName ?? new FixedLocalizableString(name); |
|||
RequiredPermissions = new List<string>(); |
|||
} |
|||
|
|||
public WidgetDefinition AddRequiredPermission(string permissionName) |
|||
{ |
|||
RequiredPermissions.Add(permissionName); |
|||
return this; |
|||
} |
|||
|
|||
public WidgetDefinition SetDefaultDimension(int width, int height) |
|||
{ |
|||
DefaultDimensions = new WidgetDimensions(width, height); |
|||
return this; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets |
|||
{ |
|||
public class WidgetDimensions |
|||
{ |
|||
public int Width { get; } |
|||
|
|||
public int Height { get; } |
|||
|
|||
public WidgetDimensions(int width, int height) |
|||
{ |
|||
Width = width; |
|||
Height = height; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets |
|||
{ |
|||
public class WidgetOptions |
|||
{ |
|||
public List<WidgetDefinition> Widgets { get; } |
|||
|
|||
public WidgetOptions() |
|||
{ |
|||
Widgets = new List<WidgetDefinition>(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Html; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.Options; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets |
|||
{ |
|||
public class WidgetRenderer : IWidgetRenderer |
|||
{ |
|||
private readonly WidgetOptions _widgetOptions; |
|||
|
|||
public WidgetRenderer(IOptions<WidgetOptions> widgetOptions) |
|||
{ |
|||
_widgetOptions = widgetOptions.Value; |
|||
} |
|||
|
|||
public async Task<IHtmlContent> RenderAsync(IViewComponentHelper componentHelper, string widgetName, object args = null) |
|||
{ |
|||
var widget = _widgetOptions.Widgets.Single(w=>w.Name.Equals(widgetName)); |
|||
|
|||
return await componentHelper.InvokeAsync(widget.ViewComponentType, args ?? new object()); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
namespace Volo.Abp.Cli |
|||
{ |
|||
public static class CliUrls |
|||
{ |
|||
#if DEBUG
|
|||
public const string WwwAbpIo = "https://localhost:44328/"; |
|||
public const string AccountAbpIo = "https://localhost:44333/"; |
|||
#else
|
|||
public const string WwwAbpIo = "https://abp.io/"; |
|||
public const string AccountAbpIo = "https://account.abp.io/"; |
|||
#endif
|
|||
} |
|||
} |
|||
@ -0,0 +1,60 @@ |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using Volo.Abp.Cli.ProjectBuilding.Files; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps |
|||
{ |
|||
public static class RenameHelper |
|||
{ |
|||
public static void RenameAll(List<FileEntry> entries, string placeHolder, string name) |
|||
{ |
|||
RenameDirectoryRecursively(entries, placeHolder, name); |
|||
RenameAllFiles(entries, placeHolder, name); |
|||
ReplaceContent(entries, placeHolder, name); |
|||
} |
|||
|
|||
private static void RenameDirectoryRecursively(List<FileEntry> entries, string placeHolder, string name) |
|||
{ |
|||
foreach (var entry in entries.Where(e => e.IsDirectory)) |
|||
{ |
|||
if (entry.Name.Contains(placeHolder)) |
|||
{ |
|||
entry.SetName(entry.Name.Replace(placeHolder, name)); |
|||
} |
|||
} |
|||
} |
|||
|
|||
private static void RenameAllFiles(List<FileEntry> entries, string placeHolder, string name) |
|||
{ |
|||
foreach (var entry in entries.Where(e => !e.IsDirectory)) |
|||
{ |
|||
if (entry.Name.Contains(placeHolder)) |
|||
{ |
|||
entry.SetName(entry.Name.Replace(placeHolder, name)); |
|||
} |
|||
} |
|||
} |
|||
|
|||
private static void ReplaceContent(List<FileEntry> entries, string placeHolder, string name) |
|||
{ |
|||
foreach (var entry in entries.Where(e => !e.IsDirectory)) |
|||
{ |
|||
if (entry.Content.Length < placeHolder.Length) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
if (entry.IsBinaryFile) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
var newContent = entry.Content.Replace(placeHolder, name); |
|||
if (newContent != entry.Content) |
|||
{ |
|||
entry.SetContent(newContent); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -1,80 +0,0 @@ |
|||
using System; |
|||
using Volo.Abp.Cli.ProjectBuilding.Files; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps |
|||
{ |
|||
public class SwitchEntityFrameworkCoreToMongoDbStep : ProjectBuildPipelineStep |
|||
{ |
|||
public override void Execute(ProjectBuildContext context) |
|||
{ |
|||
ChangeProjectReference(context); |
|||
ChangeWebModuleUsage(context); |
|||
ChangeConnectionString(context); |
|||
} |
|||
|
|||
private void ChangeProjectReference(ProjectBuildContext context) |
|||
{ |
|||
var file = context.GetFile("/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj"); |
|||
|
|||
file.NormalizeLineEndings(); |
|||
|
|||
var lines = file.GetLines(); |
|||
for (var i = 0; i < lines.Length; i++) |
|||
{ |
|||
if (lines[i].Contains("ProjectReference") && lines[i].Contains("MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations")) |
|||
{ |
|||
lines[i] = lines[i].Replace("EntityFrameworkCore.DbMigrations", "MongoDB"); |
|||
file.SetLines(lines); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
throw new ApplicationException("Could not find the EntityFrameworkCore reference in the MyCompanyName.MyProjectName.Web.csproj!"); |
|||
} |
|||
|
|||
private void ChangeWebModuleUsage(ProjectBuildContext context) |
|||
{ |
|||
var file = context.GetFile("/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs"); |
|||
|
|||
file.NormalizeLineEndings(); |
|||
|
|||
file.RemoveTemplateCodeIfNot("EntityFrameworkCore"); |
|||
|
|||
var lines = file.GetLines(); |
|||
|
|||
for (var i = 0; i < lines.Length; i++) |
|||
{ |
|||
if (lines[i].Contains("using MyCompanyName.MyProjectName.EntityFrameworkCore")) |
|||
{ |
|||
lines[i] = "using MyCompanyName.MyProjectName.MongoDb;"; |
|||
} |
|||
else if (lines[i].Contains("MyProjectNameEntityFrameworkCoreModule")) |
|||
{ |
|||
lines[i] = lines[i].Replace("MyProjectNameEntityFrameworkCoreModule", "MyProjectNameMongoDbModule"); |
|||
} |
|||
} |
|||
|
|||
file.SetLines(lines); |
|||
} |
|||
|
|||
private void ChangeConnectionString(ProjectBuildContext context) |
|||
{ |
|||
var file = context.GetFile("/src/MyCompanyName.MyProjectName.Web/appsettings.json"); |
|||
|
|||
file.NormalizeLineEndings(); |
|||
|
|||
var lines = file.GetLines(); |
|||
for (var i = 0; i < lines.Length; i++) |
|||
{ |
|||
if (lines[i].Contains("Default") && lines[i].Contains("Database")) |
|||
{ |
|||
lines[i] = " \"Default\": \"mongodb://localhost:27017|MyProjectName\""; |
|||
file.SetLines(lines); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
throw new ApplicationException("Could not find the 'Default' connection string in appsettings.json file!"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
using Volo.Abp.Cli.ProjectBuilding.Building; |
|||
using Volo.Abp.Cli.ProjectBuilding.Building.Steps; |
|||
using Volo.Abp.Cli.ProjectBuilding.Files; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectBuilding.Templates.Mvc |
|||
{ |
|||
public class MvcTemplateProjectRenameStep : ProjectBuildPipelineStep |
|||
{ |
|||
private readonly string _oldProjectName; |
|||
private readonly string _newProjectName; |
|||
|
|||
public MvcTemplateProjectRenameStep( |
|||
string oldProjectName, |
|||
string newProjectName) |
|||
{ |
|||
_oldProjectName = oldProjectName; |
|||
_newProjectName = newProjectName; |
|||
} |
|||
|
|||
public override void Execute(ProjectBuildContext context) |
|||
{ |
|||
context |
|||
.GetFile("/MyCompanyName.MyProjectName.sln") |
|||
.ReplaceText(_oldProjectName, _newProjectName); |
|||
|
|||
RenameHelper.RenameAll(context.Files, _oldProjectName, _newProjectName); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,196 @@ |
|||
using System; |
|||
using Volo.Abp.Cli.ProjectBuilding.Building; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectBuilding.Templates.Mvc |
|||
{ |
|||
public class MvcTemplateSwitchEntityFrameworkCoreToMongoDbStep : ProjectBuildPipelineStep |
|||
{ |
|||
public override void Execute(ProjectBuildContext context) |
|||
{ |
|||
//MyCompanyName.MyProjectName.Web
|
|||
|
|||
ChangeProjectReference( |
|||
context, |
|||
"/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj", |
|||
"EntityFrameworkCore.DbMigrations", |
|||
"MongoDB" |
|||
); |
|||
|
|||
ChangeModuleDependency( |
|||
context, |
|||
"/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs", |
|||
"MyCompanyName.MyProjectName.EntityFrameworkCore", |
|||
"MyCompanyName.MyProjectName.MongoDb", |
|||
"MyProjectNameEntityFrameworkCoreDbMigrationsModule", |
|||
"MyProjectNameMongoDbModule" |
|||
); |
|||
|
|||
ChangeConnectionStringToMongoDb( |
|||
context, |
|||
"/src/MyCompanyName.MyProjectName.Web/appsettings.json" |
|||
); |
|||
|
|||
//MyCompanyName.MyProjectName.IdentityServer
|
|||
|
|||
ChangeProjectReference( |
|||
context, |
|||
"/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj", |
|||
"EntityFrameworkCore.DbMigrations", |
|||
"MongoDB" |
|||
); |
|||
|
|||
ChangeModuleDependency( |
|||
context, |
|||
"/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs", |
|||
"MyCompanyName.MyProjectName.EntityFrameworkCore", |
|||
"MyCompanyName.MyProjectName.MongoDb", |
|||
"MyProjectNameEntityFrameworkCoreDbMigrationsModule", |
|||
"MyProjectNameMongoDbModule" |
|||
); |
|||
|
|||
ChangeConnectionStringToMongoDb( |
|||
context, |
|||
"/src/MyCompanyName.MyProjectName.IdentityServer/appsettings.json" |
|||
); |
|||
|
|||
//MyCompanyName.MyProjectName.HttpApi.Host
|
|||
|
|||
ChangeProjectReference( |
|||
context, |
|||
"/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj", |
|||
"EntityFrameworkCore.DbMigrations", |
|||
"MongoDB" |
|||
); |
|||
|
|||
ChangeModuleDependency( |
|||
context, |
|||
"/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs", |
|||
"MyCompanyName.MyProjectName.EntityFrameworkCore", |
|||
"MyCompanyName.MyProjectName.MongoDb", |
|||
"MyProjectNameEntityFrameworkCoreDbMigrationsModule", |
|||
"MyProjectNameMongoDbModule" |
|||
); |
|||
|
|||
ChangeConnectionStringToMongoDb( |
|||
context, |
|||
"/src/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json" |
|||
); |
|||
|
|||
//MyCompanyName.MyProjectName.DbMigrator
|
|||
|
|||
ChangeProjectReference( |
|||
context, |
|||
"/src/MyCompanyName.MyProjectName.DbMigrator/MyCompanyName.MyProjectName.DbMigrator.csproj", |
|||
"EntityFrameworkCore.DbMigrations", |
|||
"MongoDB" |
|||
); |
|||
|
|||
ChangeModuleDependency( |
|||
context, |
|||
"/src/MyCompanyName.MyProjectName.DbMigrator/MyProjectNameDbMigratorModule.cs", |
|||
"MyCompanyName.MyProjectName.EntityFrameworkCore", |
|||
"MyCompanyName.MyProjectName.MongoDb", |
|||
"MyProjectNameEntityFrameworkCoreDbMigrationsModule", |
|||
"MyProjectNameMongoDbModule" |
|||
); |
|||
|
|||
ChangeConnectionStringToMongoDb( |
|||
context, |
|||
"/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json" |
|||
); |
|||
|
|||
//MyCompanyName.MyProjectName.Domain.Tests
|
|||
|
|||
ChangeProjectReference( |
|||
context, |
|||
"/test/MyCompanyName.MyProjectName.Domain.Tests/MyCompanyName.MyProjectName.Domain.Tests.csproj", |
|||
"EntityFrameworkCore.Tests", |
|||
"MongoDB.Tests" |
|||
); |
|||
|
|||
ChangeModuleDependency( |
|||
context, |
|||
"/test/MyCompanyName.MyProjectName.Domain.Tests/MyProjectNameDomainTestModule.cs", |
|||
"MyCompanyName.MyProjectName.EntityFrameworkCore", |
|||
"MyCompanyName.MyProjectName.MongoDb", |
|||
"MyProjectNameEntityFrameworkCoreDbMigrationsModule", |
|||
"MyProjectNameMongoDbTestModule" |
|||
); |
|||
} |
|||
|
|||
private void ChangeProjectReference( |
|||
ProjectBuildContext context, |
|||
string targetProjectFilePath, |
|||
string oldReference, |
|||
string newReference) |
|||
{ |
|||
var file = context.GetFile(targetProjectFilePath); |
|||
|
|||
file.NormalizeLineEndings(); |
|||
|
|||
var lines = file.GetLines(); |
|||
for (var i = 0; i < lines.Length; i++) |
|||
{ |
|||
if (lines[i].Contains("ProjectReference") && lines[i].Contains(oldReference)) |
|||
{ |
|||
lines[i] = lines[i].Replace(oldReference, newReference); |
|||
file.SetLines(lines); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
throw new ApplicationException($"Could not find the '{oldReference}' reference in the project '{targetProjectFilePath}'!"); |
|||
} |
|||
|
|||
private void ChangeModuleDependency( |
|||
ProjectBuildContext context, |
|||
string targetModuleFilePath, |
|||
string oldNamespace, |
|||
string newNamespace, |
|||
string oldModuleName, |
|||
string newModuleName) |
|||
{ |
|||
var file = context.GetFile(targetModuleFilePath); |
|||
|
|||
file.NormalizeLineEndings(); |
|||
|
|||
var lines = file.GetLines(); |
|||
|
|||
for (var i = 0; i < lines.Length; i++) |
|||
{ |
|||
if (lines[i].Contains($"using {oldNamespace};")) |
|||
{ |
|||
lines[i] = $"using {newNamespace};"; |
|||
} |
|||
else if (lines[i].Contains(oldModuleName)) |
|||
{ |
|||
lines[i] = lines[i].Replace(oldModuleName, newModuleName); |
|||
} |
|||
} |
|||
|
|||
file.SetLines(lines); |
|||
} |
|||
|
|||
private void ChangeConnectionStringToMongoDb( |
|||
ProjectBuildContext context, |
|||
string appsettingFilePath) |
|||
{ |
|||
var file = context.GetFile(appsettingFilePath); |
|||
|
|||
file.NormalizeLineEndings(); |
|||
|
|||
var lines = file.GetLines(); |
|||
for (var i = 0; i < lines.Length; i++) |
|||
{ |
|||
if (lines[i].Contains("Default") && lines[i].Contains("Database")) |
|||
{ |
|||
lines[i] = " \"Default\": \"mongodb://localhost:27017|MyProjectName\""; |
|||
file.SetLines(lines); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
throw new ApplicationException("Could not find the 'Default' connection string in appsettings.json file!"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using Volo.Abp.Cli.ProjectBuilding.Building; |
|||
using Volo.Abp.Cli.ProjectBuilding.Files; |
|||
|
|||
namespace Volo.Abp.Cli.ProjectBuilding.Templates.Mvc |
|||
{ |
|||
public class MyTemplateChangeConsoleTestClientPortSettingsStep : ProjectBuildPipelineStep |
|||
{ |
|||
public override void Execute(ProjectBuildContext context) |
|||
{ |
|||
context |
|||
.GetFile("/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/appsettings.json") |
|||
.ReplaceText("44395", "44361") |
|||
.ReplaceText("44348", "44361"); |
|||
} |
|||
} |
|||
} |
|||
@ -1,63 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Reflection; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.DependencyInjection |
|||
{ |
|||
public static class AutoRegistrationHelper |
|||
{ |
|||
public static IEnumerable<Type> GetExposedServices(IServiceCollection services, Type type) |
|||
{ |
|||
var typeInfo = type.GetTypeInfo(); |
|||
|
|||
var customExposedServices = typeInfo |
|||
.GetCustomAttributes() |
|||
.OfType<IExposedServiceTypesProvider>() |
|||
.SelectMany(p => p.GetExposedServiceTypes(type)) |
|||
.ToList(); |
|||
|
|||
if (customExposedServices.Any()) |
|||
{ |
|||
return customExposedServices; |
|||
} |
|||
|
|||
return GetDefaultExposedServices(services, type); |
|||
} |
|||
|
|||
private static IEnumerable<Type> GetDefaultExposedServices(IServiceCollection services, Type type) |
|||
{ |
|||
var serviceTypes = new List<Type>(); |
|||
|
|||
serviceTypes.Add(type); |
|||
|
|||
foreach (var interfaceType in type.GetTypeInfo().GetInterfaces()) |
|||
{ |
|||
var interfaceName = interfaceType.Name; |
|||
|
|||
if (interfaceName.StartsWith("I")) |
|||
{ |
|||
interfaceName = interfaceName.Right(interfaceName.Length - 1); |
|||
} |
|||
|
|||
if (type.Name.EndsWith(interfaceName)) |
|||
{ |
|||
serviceTypes.Add(interfaceType); |
|||
} |
|||
} |
|||
|
|||
var exposeActions = services.GetExposingActionList(); |
|||
if (exposeActions.Any()) |
|||
{ |
|||
var args = new OnServiceExposingContext(type, serviceTypes); |
|||
foreach (var action in services.GetExposingActionList()) |
|||
{ |
|||
action(args); |
|||
} |
|||
} |
|||
|
|||
return serviceTypes; |
|||
} |
|||
} |
|||
} |
|||
@ -1,19 +1,67 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Reflection; |
|||
|
|||
namespace Volo.Abp.DependencyInjection |
|||
{ |
|||
public class ExposeServicesAttribute : Attribute, IExposedServiceTypesProvider |
|||
{ |
|||
public Type[] ExposedServiceTypes { get; } |
|||
public Type[] ServiceTypes { get; } |
|||
|
|||
public ExposeServicesAttribute(params Type[] exposedServiceTypes) |
|||
public bool? IncludeDefaults { get; set; } |
|||
|
|||
public bool? IncludeSelf { get; set; } |
|||
|
|||
public ExposeServicesAttribute(params Type[] serviceTypes) |
|||
{ |
|||
ExposedServiceTypes = exposedServiceTypes ?? new Type[0]; |
|||
ServiceTypes = serviceTypes ?? new Type[0]; |
|||
} |
|||
|
|||
public Type[] GetExposedServiceTypes(Type targetType) |
|||
{ |
|||
return ExposedServiceTypes; |
|||
var serviceList = ServiceTypes.ToList(); |
|||
|
|||
if (IncludeDefaults == true) |
|||
{ |
|||
foreach (var type in GetDefaultServices(targetType)) |
|||
{ |
|||
serviceList.AddIfNotContains(type); |
|||
} |
|||
|
|||
if (IncludeSelf != false) |
|||
{ |
|||
serviceList.AddIfNotContains(targetType); |
|||
} |
|||
} |
|||
else if (IncludeSelf == true) |
|||
{ |
|||
serviceList.AddIfNotContains(targetType); |
|||
} |
|||
|
|||
return serviceList.ToArray(); |
|||
} |
|||
|
|||
private static List<Type> GetDefaultServices(Type type) |
|||
{ |
|||
var serviceTypes = new List<Type>(); |
|||
|
|||
foreach (var interfaceType in type.GetTypeInfo().GetInterfaces()) |
|||
{ |
|||
var interfaceName = interfaceType.Name; |
|||
|
|||
if (interfaceName.StartsWith("I")) |
|||
{ |
|||
interfaceName = interfaceName.Right(interfaceName.Length - 1); |
|||
} |
|||
|
|||
if (type.Name.EndsWith(interfaceName)) |
|||
{ |
|||
serviceTypes.Add(interfaceType); |
|||
} |
|||
} |
|||
|
|||
return serviceTypes; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Reflection; |
|||
|
|||
namespace Volo.Abp.DependencyInjection |
|||
{ |
|||
public static class ExposedServiceExplorer |
|||
{ |
|||
private static readonly ExposeServicesAttribute DefaultExposeServicesAttribute = |
|||
new ExposeServicesAttribute |
|||
{ |
|||
IncludeDefaults = true |
|||
}; |
|||
|
|||
public static List<Type> GetExposedServices(Type type) |
|||
{ |
|||
return type |
|||
.GetCustomAttributes() |
|||
.OfType<IExposedServiceTypesProvider>() |
|||
.DefaultIfEmpty(DefaultExposeServicesAttribute) |
|||
.SelectMany(p => p.GetExposedServiceTypes(type)) |
|||
.ToList(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
using Shouldly; |
|||
using Xunit; |
|||
|
|||
namespace System |
|||
{ |
|||
public class AbpTypeExtensions_Tests |
|||
{ |
|||
[Fact] |
|||
public void GetBaseClasses() |
|||
{ |
|||
var baseClasses = typeof(MyClass).GetBaseClasses(includeObject: false); |
|||
baseClasses.Length.ShouldBe(2); |
|||
baseClasses[0].ShouldBe(typeof(MyBaseClass1)); |
|||
baseClasses[1].ShouldBe(typeof(MyBaseClass2)); |
|||
} |
|||
|
|||
public abstract class MyBaseClass1 |
|||
{ |
|||
|
|||
} |
|||
|
|||
public class MyBaseClass2 : MyBaseClass1 |
|||
{ |
|||
|
|||
} |
|||
|
|||
public class MyClass : MyBaseClass2 |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-alpine AS base |
|||
WORKDIR /app |
|||
EXPOSE 80 |
|||
|
|||
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine AS build |
|||
WORKDIR /src |
|||
COPY . . |
|||
WORKDIR "/src/modules/docs/app/VoloDocs.Migrator" |
|||
RUN dotnet restore -nowarn:msb3202,nu1503 |
|||
RUN dotnet build --no-restore -c Release -o /app |
|||
|
|||
FROM build AS publish |
|||
RUN dotnet publish --no-restore -c Release -o /app |
|||
|
|||
FROM base AS final |
|||
WORKDIR /app |
|||
COPY --from=publish /app . |
|||
ENTRYPOINT ["dotnet", "VoloDocs.Migrator.dll"] |
|||
@ -0,0 +1,18 @@ |
|||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-alpine AS base |
|||
WORKDIR /app |
|||
EXPOSE 80 |
|||
|
|||
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine AS build |
|||
WORKDIR /src |
|||
COPY . . |
|||
WORKDIR "/src/modules/docs/app/VoloDocs.Web" |
|||
RUN dotnet restore -nowarn:msb3202,nu1503 |
|||
RUN dotnet build --no-restore -c Release -o /app |
|||
|
|||
FROM build AS publish |
|||
RUN dotnet publish --no-restore -c Release -o /app |
|||
|
|||
FROM base AS final |
|||
WORKDIR /app |
|||
COPY --from=publish /app . |
|||
ENTRYPOINT ["dotnet", "VoloDocs.Web.dll"] |
|||
@ -0,0 +1,12 @@ |
|||
version: '3.4' |
|||
|
|||
services: |
|||
volo-docs-migrator: |
|||
image: 'volosoft/volo-docs-migrator:${TAG:-latest}' |
|||
build: |
|||
context: ../../ |
|||
dockerfile: modules/docs/app/VoloDocs.Migrator/Dockerfile |
|||
environment: |
|||
- ConnectionString=Server=sqlserver;Database=VoloDocs;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false |
|||
depends_on: |
|||
- sqlserver |
|||
@ -0,0 +1,17 @@ |
|||
version: '3.4' |
|||
|
|||
services: |
|||
sqlserver: |
|||
environment: |
|||
- SA_PASSWORD=yourStrong(!)Password |
|||
- ACCEPT_EULA=Y |
|||
ports: |
|||
- "1433:1433" |
|||
|
|||
volo-docs: |
|||
environment: |
|||
- ConnectionString=Server=sqlserver;Database=VoloDocs;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false |
|||
- Title=VoloDocs |
|||
- LogoUrl=/assets/images/Logo.png |
|||
ports: |
|||
- "80:80" |
|||
@ -0,0 +1,18 @@ |
|||
version: '3.4' |
|||
|
|||
services: |
|||
sqlserver: |
|||
image: mcr.microsoft.com/mssql/server |
|||
volumes: |
|||
- dbdata:/var/opt/mssql |
|||
|
|||
volo-docs: |
|||
image: 'volosoft/volo-docs:${TAG:-latest}' |
|||
build: |
|||
context: ../../ |
|||
dockerfile: modules/docs/app/VoloDocs.Web/Dockerfile |
|||
depends_on: |
|||
- sqlserver |
|||
|
|||
volumes: |
|||
dbdata: |
|||
@ -0,0 +1 @@ |
|||
**/wwwroot/libs/** linguist-vendored |
|||
@ -0,0 +1,255 @@ |
|||
## Ignore Visual Studio temporary files, build results, and |
|||
## files generated by popular Visual Studio add-ons. |
|||
|
|||
# User-specific files |
|||
*.suo |
|||
*.user |
|||
*.userosscache |
|||
*.sln.docstates |
|||
|
|||
# User-specific files (MonoDevelop/Xamarin Studio) |
|||
*.userprefs |
|||
|
|||
# Build results |
|||
[Dd]ebug/ |
|||
[Dd]ebugPublic/ |
|||
[Rr]elease/ |
|||
[Rr]eleases/ |
|||
x64/ |
|||
x86/ |
|||
bld/ |
|||
[Bb]in/ |
|||
[Oo]bj/ |
|||
[Ll]og/ |
|||
|
|||
# Visual Studio 2015 cache/options directory |
|||
.vs/ |
|||
# Uncomment if you have tasks that create the project's static files in wwwroot |
|||
#wwwroot/ |
|||
|
|||
# MSTest test Results |
|||
[Tt]est[Rr]esult*/ |
|||
[Bb]uild[Ll]og.* |
|||
|
|||
# NUNIT |
|||
*.VisualState.xml |
|||
TestResult.xml |
|||
|
|||
# Build Results of an ATL Project |
|||
[Dd]ebugPS/ |
|||
[Rr]eleasePS/ |
|||
dlldata.c |
|||
|
|||
# DNX |
|||
project.lock.json |
|||
artifacts/ |
|||
|
|||
*_i.c |
|||
*_p.c |
|||
*_i.h |
|||
*.ilk |
|||
*.meta |
|||
*.obj |
|||
*.pch |
|||
*.pdb |
|||
*.pgc |
|||
*.pgd |
|||
*.rsp |
|||
*.sbr |
|||
*.tlb |
|||
*.tli |
|||
*.tlh |
|||
*.tmp |
|||
*.tmp_proj |
|||
*.log |
|||
*.vspscc |
|||
*.vssscc |
|||
.builds |
|||
*.pidb |
|||
*.svclog |
|||
*.scc |
|||
|
|||
# Chutzpah Test files |
|||
_Chutzpah* |
|||
|
|||
# Visual C++ cache files |
|||
ipch/ |
|||
*.aps |
|||
*.ncb |
|||
*.opendb |
|||
*.opensdf |
|||
*.sdf |
|||
*.cachefile |
|||
*.VC.db |
|||
*.VC.VC.opendb |
|||
|
|||
# Visual Studio profiler |
|||
*.psess |
|||
*.vsp |
|||
*.vspx |
|||
*.sap |
|||
|
|||
# TFS 2012 Local Workspace |
|||
$tf/ |
|||
|
|||
# Guidance Automation Toolkit |
|||
*.gpState |
|||
|
|||
# ReSharper is a .NET coding add-in |
|||
_ReSharper*/ |
|||
*.[Rr]e[Ss]harper |
|||
*.DotSettings.user |
|||
|
|||
# JustCode is a .NET coding add-in |
|||
.JustCode |
|||
|
|||
# TeamCity is a build add-in |
|||
_TeamCity* |
|||
|
|||
# DotCover is a Code Coverage Tool |
|||
*.dotCover |
|||
|
|||
# NCrunch |
|||
_NCrunch_* |
|||
.*crunch*.local.xml |
|||
nCrunchTemp_* |
|||
|
|||
# MightyMoose |
|||
*.mm.* |
|||
AutoTest.Net/ |
|||
|
|||
# Web workbench (sass) |
|||
.sass-cache/ |
|||
|
|||
# Installshield output folder |
|||
[Ee]xpress/ |
|||
|
|||
# DocProject is a documentation generator add-in |
|||
DocProject/buildhelp/ |
|||
DocProject/Help/*.HxT |
|||
DocProject/Help/*.HxC |
|||
DocProject/Help/*.hhc |
|||
DocProject/Help/*.hhk |
|||
DocProject/Help/*.hhp |
|||
DocProject/Help/Html2 |
|||
DocProject/Help/html |
|||
|
|||
# Click-Once directory |
|||
publish/ |
|||
|
|||
# Publish Web Output |
|||
*.[Pp]ublish.xml |
|||
*.azurePubxml |
|||
# TODO: Comment the next line if you want to checkin your web deploy settings |
|||
# but database connection strings (with potential passwords) will be unencrypted |
|||
*.pubxml |
|||
*.publishproj |
|||
|
|||
# Microsoft Azure Web App publish settings. Comment the next line if you want to |
|||
# checkin your Azure Web App publish settings, but sensitive information contained |
|||
# in these scripts will be unencrypted |
|||
PublishScripts/ |
|||
|
|||
# NuGet Packages |
|||
*.nupkg |
|||
# The packages folder can be ignored because of Package Restore |
|||
**/packages/* |
|||
# except build/, which is used as an MSBuild target. |
|||
!**/packages/build/ |
|||
# Uncomment if necessary however generally it will be regenerated when needed |
|||
#!**/packages/repositories.config |
|||
# NuGet v3's project.json files produces more ignoreable files |
|||
*.nuget.props |
|||
*.nuget.targets |
|||
|
|||
# Microsoft Azure Build Output |
|||
csx/ |
|||
*.build.csdef |
|||
|
|||
# Microsoft Azure Emulator |
|||
ecf/ |
|||
rcf/ |
|||
|
|||
# Windows Store app package directories and files |
|||
AppPackages/ |
|||
BundleArtifacts/ |
|||
Package.StoreAssociation.xml |
|||
_pkginfo.txt |
|||
|
|||
# Visual Studio cache files |
|||
# files ending in .cache can be ignored |
|||
*.[Cc]ache |
|||
# but keep track of directories ending in .cache |
|||
!*.[Cc]ache/ |
|||
|
|||
# Others |
|||
ClientBin/ |
|||
~$* |
|||
*~ |
|||
*.dbmdl |
|||
*.dbproj.schemaview |
|||
*.pfx |
|||
*.publishsettings |
|||
node_modules/ |
|||
orleans.codegen.cs |
|||
|
|||
# Since there are multiple workflows, uncomment next line to ignore bower_components |
|||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) |
|||
#bower_components/ |
|||
|
|||
# RIA/Silverlight projects |
|||
Generated_Code/ |
|||
|
|||
# Backup & report files from converting an old project file |
|||
# to a newer Visual Studio version. Backup files are not needed, |
|||
# because we have git ;-) |
|||
_UpgradeReport_Files/ |
|||
Backup*/ |
|||
UpgradeLog*.XML |
|||
UpgradeLog*.htm |
|||
|
|||
# SQL Server files |
|||
*.mdf |
|||
*.ldf |
|||
|
|||
# Business Intelligence projects |
|||
*.rdl.data |
|||
*.bim.layout |
|||
*.bim_*.settings |
|||
|
|||
# Microsoft Fakes |
|||
FakesAssemblies/ |
|||
|
|||
# GhostDoc plugin setting file |
|||
*.GhostDoc.xml |
|||
|
|||
# Node.js Tools for Visual Studio |
|||
.ntvs_analysis.dat |
|||
|
|||
# Visual Studio 6 build log |
|||
*.plg |
|||
|
|||
# Visual Studio 6 workspace options file |
|||
*.opt |
|||
|
|||
# Visual Studio LightSwitch build output |
|||
**/*.HTMLClient/GeneratedArtifacts |
|||
**/*.DesktopClient/GeneratedArtifacts |
|||
**/*.DesktopClient/ModelManifest.xml |
|||
**/*.Server/GeneratedArtifacts |
|||
**/*.Server/ModelManifest.xml |
|||
_Pvt_Extensions |
|||
|
|||
# Paket dependency manager |
|||
.paket/paket.exe |
|||
paket-files/ |
|||
|
|||
# FAKE - F# Make |
|||
.fake/ |
|||
|
|||
# JetBrains Rider |
|||
.idea/ |
|||
*.sln.iml |
|||
|
|||
# DashboardDemo |
|||
src/DashboardDemo.Web/Logs/logs.txt |
|||
@ -0,0 +1,74 @@ |
|||
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00 |
|||
# Visual Studio 15 |
|||
VisualStudioVersion = 15.0.27703.1 |
|||
MinimumVisualStudioVersion = 10.0.40219.1 |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DashboardDemo.Domain", "src\DashboardDemo.Domain\DashboardDemo.Domain.csproj", "{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DashboardDemo.Application", "src\DashboardDemo.Application\DashboardDemo.Application.csproj", "{1A94A50E-06DC-43C1-80B5-B662820EC3EB}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DashboardDemo.EntityFrameworkCore", "src\DashboardDemo.EntityFrameworkCore\DashboardDemo.EntityFrameworkCore.csproj", "{C956DD76-69C8-4A9C-83EA-D17DF83340FD}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DashboardDemo.Web", "src\DashboardDemo.Web\DashboardDemo.Web.csproj", "{068855E8-9240-4F1A-910B-CF825794513B}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CA9AC87F-097E-4F15-8393-4BC07735A5B0}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{04DBDB01-70F4-4E06-B468-8F87850B22BE}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DashboardDemo.Application.Tests", "test\DashboardDemo.Application.Tests\DashboardDemo.Application.Tests.csproj", "{50B2631D-129C-47B3-A587-029CCD6099BC}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DashboardDemo.Web.Tests", "test\DashboardDemo.Web.Tests\DashboardDemo.Web.Tests.csproj", "{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DashboardDemo.EntityFrameworkCore.DbMigrations", "src\DashboardDemo.EntityFrameworkCore.DbMigrations\DashboardDemo.EntityFrameworkCore.DbMigrations.csproj", "{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}" |
|||
EndProject |
|||
Global |
|||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|||
Debug|Any CPU = Debug|Any CPU |
|||
Release|Any CPU = Release|Any CPU |
|||
EndGlobalSection |
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|||
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{068855E8-9240-4F1A-910B-CF825794513B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{068855E8-9240-4F1A-910B-CF825794513B}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{068855E8-9240-4F1A-910B-CF825794513B}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{068855E8-9240-4F1A-910B-CF825794513B}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{50B2631D-129C-47B3-A587-029CCD6099BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{50B2631D-129C-47B3-A587-029CCD6099BC}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{50B2631D-129C-47B3-A587-029CCD6099BC}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{50B2631D-129C-47B3-A587-029CCD6099BC}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
EndGlobalSection |
|||
GlobalSection(SolutionProperties) = preSolution |
|||
HideSolutionNode = FALSE |
|||
EndGlobalSection |
|||
GlobalSection(NestedProjects) = preSolution |
|||
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{1A94A50E-06DC-43C1-80B5-B662820EC3EB} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{C956DD76-69C8-4A9C-83EA-D17DF83340FD} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{068855E8-9240-4F1A-910B-CF825794513B} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{50B2631D-129C-47B3-A587-029CCD6099BC} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} |
|||
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} |
|||
{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
EndGlobalSection |
|||
GlobalSection(ExtensibilityGlobals) = postSolution |
|||
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} |
|||
EndGlobalSection |
|||
EndGlobal |
|||
@ -0,0 +1,7 @@ |
|||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> |
|||
<s:Boolean x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=59923913AE66194DB837F628B1FC08BE/@KeyIndexDefined">True</s:Boolean> |
|||
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=59923913AE66194DB837F628B1FC08BE/AbsolutePath/@EntryValue">D:\github\abp\common.DotSettings</s:String> |
|||
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=59923913AE66194DB837F628B1FC08BE/RelativePath/@EntryValue">..\..\..\common.DotSettings</s:String> |
|||
<s:Boolean x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File59923913AE66194DB837F628B1FC08BE/@KeyIndexDefined">True</s:Boolean> |
|||
<s:Double x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File59923913AE66194DB837F628B1FC08BE/RelativePriority/@EntryValue">1</s:Double> |
|||
</wpf:ResourceDictionary> |
|||
@ -0,0 +1,7 @@ |
|||
<Project> |
|||
<PropertyGroup> |
|||
<LangVersion>latest</LangVersion> |
|||
<Version>1.0.0</Version> |
|||
<NoWarn>$(NoWarn);CS1591</NoWarn> |
|||
</PropertyGroup> |
|||
</Project> |
|||
@ -0,0 +1,18 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp2.2</TargetFramework> |
|||
<RootNamespace>DashboardDemo</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\DashboardDemo.Domain\DashboardDemo.Domain.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Application\Volo.Abp.TenantManagement.Application.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,12 @@ |
|||
using AutoMapper; |
|||
|
|||
namespace DashboardDemo |
|||
{ |
|||
public class DashboardDemoApplicationAutoMapperProfile : Profile |
|||
{ |
|||
public DashboardDemoApplicationAutoMapperProfile() |
|||
{ |
|||
//Configure your AutoMapper mapping configuration here...
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
using Volo.Abp.AutoMapper; |
|||
using Volo.Abp.FeatureManagement; |
|||
using Volo.Abp.Identity; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.PermissionManagement; |
|||
using Volo.Abp.TenantManagement; |
|||
|
|||
namespace DashboardDemo |
|||
{ |
|||
[DependsOn( |
|||
typeof(DashboardDemoDomainModule), |
|||
typeof(AbpIdentityApplicationModule), |
|||
typeof(AbpPermissionManagementApplicationModule), |
|||
typeof(AbpTenantManagementApplicationModule), |
|||
typeof(AbpFeatureManagementApplicationModule) |
|||
)] |
|||
public class DashboardDemoApplicationModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpAutoMapperOptions>(options => |
|||
{ |
|||
options.AddProfile<DashboardDemoApplicationAutoMapperProfile>(); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
using DashboardDemo.Localization.DashboardDemo; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace DashboardDemo.Permissions |
|||
{ |
|||
public class DashboardDemoPermissionDefinitionProvider : PermissionDefinitionProvider |
|||
{ |
|||
public override void Define(IPermissionDefinitionContext context) |
|||
{ |
|||
var myGroup = context.AddGroup(DashboardDemoPermissions.GroupName); |
|||
|
|||
//Define your own permissions here. Examaple:
|
|||
//myGroup.AddPermission(DashboardDemoPermissions.MyPermission1, L("Permission:MyPermission1"));
|
|||
} |
|||
|
|||
private static LocalizableString L(string name) |
|||
{ |
|||
return LocalizableString.Create<DashboardDemoResource>(name); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using System; |
|||
using Volo.Abp.Reflection; |
|||
|
|||
namespace DashboardDemo.Permissions |
|||
{ |
|||
public static class DashboardDemoPermissions |
|||
{ |
|||
public const string GroupName = "DashboardDemo"; |
|||
|
|||
//Add your own permission names. Example:
|
|||
//public const string MyPermission1 = GroupName + ".MyPermission1";
|
|||
|
|||
public static string[] GetAll() |
|||
{ |
|||
//Return an array of all permissions
|
|||
return ReflectionHelper.GetPublicConstantsRecursively(typeof(DashboardDemoPermissions)); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp2.2</TargetFramework> |
|||
<RootNamespace>DashboardDemo</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Auditing\Volo.Abp.Auditing.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Domain\Volo.Abp.Identity.Domain.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\modules\background-jobs\src\Volo.Abp.BackgroundJobs.Domain\Volo.Abp.BackgroundJobs.Domain.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.Domain\Volo.Abp.AuditLogging.Domain.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Domain\Volo.Abp.TenantManagement.Domain.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Domain\Volo.Abp.FeatureManagement.Domain.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.2.0" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<EmbeddedResource Include="Localization\DashboardDemo\*.json" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,11 @@ |
|||
namespace DashboardDemo |
|||
{ |
|||
public static class DashboardDemoConsts |
|||
{ |
|||
public const string DbTablePrefix = "App"; |
|||
|
|||
public const string DbSchema = null; |
|||
|
|||
public const bool IsMultiTenancyEnabled = true; |
|||
} |
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
using DashboardDemo.Localization.DashboardDemo; |
|||
using Volo.Abp.Auditing; |
|||
using Volo.Abp.AuditLogging; |
|||
using Volo.Abp.BackgroundJobs; |
|||
using Volo.Abp.FeatureManagement; |
|||
using Volo.Abp.Identity; |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.Localization.Resources.AbpValidation; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.PermissionManagement.Identity; |
|||
using Volo.Abp.TenantManagement; |
|||
using Volo.Abp.VirtualFileSystem; |
|||
|
|||
namespace DashboardDemo |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpIdentityDomainModule), |
|||
typeof(AbpPermissionManagementDomainIdentityModule), |
|||
typeof(AbpAuditingModule), |
|||
typeof(BackgroundJobsDomainModule), |
|||
typeof(AbpAuditLoggingDomainModule), |
|||
typeof(AbpTenantManagementDomainModule), |
|||
typeof(AbpFeatureManagementDomainModule) |
|||
)] |
|||
public class DashboardDemoDomainModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<VirtualFileSystemOptions>(options => |
|||
{ |
|||
options.FileSets.AddEmbedded<DashboardDemoDomainModule>("DashboardDemo"); |
|||
}); |
|||
|
|||
Configure<AbpLocalizationOptions>(options => |
|||
{ |
|||
options.Resources |
|||
.Add<DashboardDemoResource>("en") |
|||
.AddBaseTypes(typeof(AbpValidationResource)) |
|||
.AddVirtualJson("/Localization/DashboardDemo"); |
|||
}); |
|||
|
|||
Configure<MultiTenancyOptions>(options => |
|||
{ |
|||
options.IsEnabled = DashboardDemoConsts.IsMultiTenancyEnabled; |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace DashboardDemo.Localization.DashboardDemo |
|||
{ |
|||
[LocalizationResourceName("DashboardDemo")] |
|||
public class DashboardDemoResource |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
"Menu:Home": "Home", |
|||
"Welcome": "Welcome", |
|||
"RolesInApplication": "Roles in application", |
|||
"UserCount": "User count", |
|||
"LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using Volo.Abp.Settings; |
|||
|
|||
namespace DashboardDemo.Settings |
|||
{ |
|||
public class DashboardDemoSettingDefinitionProvider : SettingDefinitionProvider |
|||
{ |
|||
public override void Define(ISettingDefinitionContext context) |
|||
{ |
|||
//Define your own settings here. Example:
|
|||
//context.Add(new SettingDefinition(DashboardDemoSettings.MySetting1));
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
namespace DashboardDemo.Settings |
|||
{ |
|||
public static class DashboardDemoSettings |
|||
{ |
|||
private const string Prefix = "DashboardDemo"; |
|||
|
|||
//Add your own setting names here. Example:
|
|||
//public const string MySetting1 = Prefix + ".MySetting1";
|
|||
} |
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Entities.Auditing; |
|||
using Volo.Abp.Users; |
|||
|
|||
namespace DashboardDemo.Users |
|||
{ |
|||
/* This entity shares the same table/collection ("AbpUsers" by default) with the |
|||
* IdentityUser entity of the Identity module. |
|||
* |
|||
* - You can define your custom properties into this class. |
|||
* - You never create or delete this entity, becase it is Identity module's job. |
|||
* - You can query users from database with this entity. |
|||
* - You can update values of your custom properties. |
|||
*/ |
|||
public class AppUser : FullAuditedAggregateRoot<Guid>, IUser |
|||
{ |
|||
#region Base properties
|
|||
|
|||
/* These properties are shared with the IdentityUser entity of the Identity module. |
|||
* Do not change these properties through this class. Instead, use Identity module |
|||
* services (like IdentityUserManager) to change them. |
|||
* So, this properties are designed as read only! |
|||
*/ |
|||
|
|||
public virtual Guid? TenantId { get; private set; } |
|||
|
|||
public virtual string UserName { get; private set; } |
|||
|
|||
public virtual string Name { get; private set; } |
|||
|
|||
public virtual string Surname { get; private set; } |
|||
|
|||
public virtual string Email { get; private set; } |
|||
|
|||
public virtual bool EmailConfirmed { get; private set; } |
|||
|
|||
public virtual string PhoneNumber { get; private set; } |
|||
|
|||
public virtual bool PhoneNumberConfirmed { get; private set; } |
|||
|
|||
#endregion
|
|||
|
|||
/* Add your own properties here. Example: |
|||
* |
|||
* public virtual string MyProperty { get; set; } |
|||
*/ |
|||
|
|||
private AppUser() |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp2.2</TargetFramework> |
|||
<RootNamespace>DashboardDemo</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<Compile Remove="Migrations\20190320072839_Initial.cs" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\DashboardDemo.EntityFrameworkCore\DashboardDemo.EntityFrameworkCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue