mirror of https://github.com/abpframework/abp.git
114 changed files with 5053 additions and 5256 deletions
@ -1,12 +1,11 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Blazor.Host |
namespace MyCompanyName.MyProjectName.Blazor.Host; |
||||
|
|
||||
|
public class MyProjectNameBlazorHostAutoMapperProfile : Profile |
||||
{ |
{ |
||||
public class MyProjectNameBlazorHostAutoMapperProfile : Profile |
public MyProjectNameBlazorHostAutoMapperProfile() |
||||
{ |
{ |
||||
public MyProjectNameBlazorHostAutoMapperProfile() |
//Define your AutoMapper configuration here for the Blazor project.
|
||||
{ |
|
||||
//Define your AutoMapper configuration here for the Blazor project.
|
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,17 +1,16 @@ |
|||||
using Volo.Abp.Bundling; |
using Volo.Abp.Bundling; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Blazor.Host |
namespace MyCompanyName.MyProjectName.Blazor.Host; |
||||
|
|
||||
|
public class MyProjectNameBlazorHostBundleContributor : IBundleContributor |
||||
{ |
{ |
||||
public class MyProjectNameBlazorHostBundleContributor : IBundleContributor |
public void AddScripts(BundleContext context) |
||||
{ |
{ |
||||
public void AddScripts(BundleContext context) |
|
||||
{ |
|
||||
|
|
||||
} |
} |
||||
|
|
||||
public void AddStyles(BundleContext context) |
public void AddStyles(BundleContext context) |
||||
{ |
{ |
||||
context.Add("main.css", true); |
context.Add("main.css", true); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
using Volo.Abp.Ui.Branding; |
using Volo.Abp.Ui.Branding; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Blazor.Host |
namespace MyCompanyName.MyProjectName.Blazor.Host; |
||||
|
|
||||
|
public class MyProjectNameHostBrandingProvider : DefaultBrandingProvider |
||||
{ |
{ |
||||
public class MyProjectNameHostBrandingProvider : DefaultBrandingProvider |
public override string AppName => "MyProjectName"; |
||||
{ |
|
||||
public override string AppName => "MyProjectName"; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,24 +1,23 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; |
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Blazor.Host |
namespace MyCompanyName.MyProjectName.Blazor.Host; |
||||
|
|
||||
|
public class Program |
||||
{ |
{ |
||||
public class Program |
public static async Task Main(string[] args) |
||||
{ |
{ |
||||
public static async Task Main(string[] args) |
var builder = WebAssemblyHostBuilder.CreateDefault(args); |
||||
{ |
|
||||
var builder = WebAssemblyHostBuilder.CreateDefault(args); |
|
||||
|
|
||||
var application = builder.AddApplication<MyProjectNameBlazorHostModule>(options => |
var application = builder.AddApplication<MyProjectNameBlazorHostModule>(options => |
||||
{ |
{ |
||||
options.UseAutofac(); |
options.UseAutofac(); |
||||
}); |
}); |
||||
|
|
||||
var host = builder.Build(); |
var host = builder.Build(); |
||||
|
|
||||
await application.InitializeAsync(host.Services); |
await application.InitializeAsync(host.Services); |
||||
|
|
||||
await host.RunAsync(); |
await host.RunAsync(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Menus |
namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Menus; |
||||
|
|
||||
|
public class MyProjectNameMenus |
||||
{ |
{ |
||||
public class MyProjectNameMenus |
private const string Prefix = "MyProjectName"; |
||||
{ |
|
||||
private const string Prefix = "MyProjectName"; |
|
||||
|
|
||||
//Add your menu items here...
|
//Add your menu items here...
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
File diff suppressed because it is too large
@ -1,11 +1,10 @@ |
|||||
using Volo.Abp.DependencyInjection; |
using Volo.Abp.DependencyInjection; |
||||
using Volo.Abp.Ui.Branding; |
using Volo.Abp.Ui.Branding; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Blazor.Server.Host |
namespace MyCompanyName.MyProjectName.Blazor.Server.Host; |
||||
|
|
||||
|
[Dependency(ReplaceServices = true)] |
||||
|
public class MyProjectNameBrandingProvider : DefaultBrandingProvider |
||||
{ |
{ |
||||
[Dependency(ReplaceServices = true)] |
public override string AppName => "MyProjectName"; |
||||
public class MyProjectNameBrandingProvider : DefaultBrandingProvider |
|
||||
{ |
|
||||
public override string AppName => "MyProjectName"; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using MyCompanyName.MyProjectName.Localization; |
using MyCompanyName.MyProjectName.Localization; |
||||
using Volo.Abp.AspNetCore.Components; |
using Volo.Abp.AspNetCore.Components; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Blazor.Server.Host |
namespace MyCompanyName.MyProjectName.Blazor.Server.Host; |
||||
|
|
||||
|
public abstract class MyProjectNameComponentBase : AbpComponentBase |
||||
{ |
{ |
||||
public abstract class MyProjectNameComponentBase : AbpComponentBase |
protected MyProjectNameComponentBase() |
||||
{ |
{ |
||||
protected MyProjectNameComponentBase() |
LocalizationResource = typeof(MyProjectNameResource); |
||||
{ |
|
||||
LocalizationResource = typeof(MyProjectNameResource); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,6 +1,5 @@ |
|||||
namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Pages |
namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Pages; |
||||
|
|
||||
|
public partial class Index |
||||
{ |
{ |
||||
public partial class Index |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
namespace MyCompanyName.MyProjectName.MultiTenancy |
namespace MyCompanyName.MyProjectName.MultiTenancy; |
||||
|
|
||||
|
public static class MultiTenancyConsts |
||||
{ |
{ |
||||
public static class MultiTenancyConsts |
/* Enable/disable multi-tenancy in a single point |
||||
{ |
* to test your module with multi-tenancy. |
||||
/* Enable/disable multi-tenancy in a single point |
*/ |
||||
* to test your module with multi-tenancy. |
public const bool IsEnabled = false; |
||||
*/ |
|
||||
public const bool IsEnabled = false; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using Microsoft.AspNetCore.Mvc; |
using Microsoft.AspNetCore.Mvc; |
||||
using Volo.Abp.AspNetCore.Mvc; |
using Volo.Abp.AspNetCore.Mvc; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Controllers |
namespace MyCompanyName.MyProjectName.Controllers; |
||||
|
|
||||
|
public class HomeController : AbpController |
||||
{ |
{ |
||||
public class HomeController : AbpController |
public ActionResult Index() |
||||
{ |
{ |
||||
public ActionResult Index() |
return Redirect("~/swagger"); |
||||
{ |
|
||||
return Redirect("~/swagger"); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,21 +1,20 @@ |
|||||
using Microsoft.EntityFrameworkCore; |
using Microsoft.EntityFrameworkCore; |
||||
using Volo.Abp.EntityFrameworkCore; |
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.EntityFrameworkCore |
namespace MyCompanyName.MyProjectName.EntityFrameworkCore; |
||||
|
|
||||
|
public class MyProjectNameHttpApiHostMigrationsDbContext : AbpDbContext<MyProjectNameHttpApiHostMigrationsDbContext> |
||||
{ |
{ |
||||
public class MyProjectNameHttpApiHostMigrationsDbContext : AbpDbContext<MyProjectNameHttpApiHostMigrationsDbContext> |
public MyProjectNameHttpApiHostMigrationsDbContext(DbContextOptions<MyProjectNameHttpApiHostMigrationsDbContext> options) |
||||
|
: base(options) |
||||
{ |
{ |
||||
public MyProjectNameHttpApiHostMigrationsDbContext(DbContextOptions<MyProjectNameHttpApiHostMigrationsDbContext> options) |
|
||||
: base(options) |
|
||||
{ |
|
||||
|
|
||||
} |
} |
||||
|
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder) |
protected override void OnModelCreating(ModelBuilder modelBuilder) |
||||
{ |
{ |
||||
base.OnModelCreating(modelBuilder); |
base.OnModelCreating(modelBuilder); |
||||
|
|
||||
modelBuilder.ConfigureMyProjectName(); |
modelBuilder.ConfigureMyProjectName(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
File diff suppressed because it is too large
@ -1,11 +1,10 @@ |
|||||
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; |
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Pages |
namespace MyCompanyName.MyProjectName.Pages; |
||||
|
|
||||
|
public class IndexModel : AbpPageModel |
||||
{ |
{ |
||||
public class IndexModel : AbpPageModel |
public void OnGet() |
||||
{ |
{ |
||||
public void OnGet() |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
using Volo.Abp.AspNetCore.Mvc.Authentication; |
using Volo.Abp.AspNetCore.Mvc.Authentication; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Controllers |
namespace MyCompanyName.MyProjectName.Controllers; |
||||
|
|
||||
|
public class AccountController : ChallengeAccountController |
||||
{ |
{ |
||||
public class AccountController : ChallengeAccountController |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,11 +1,10 @@ |
|||||
using Volo.Abp.Ui.Branding; |
using Volo.Abp.Ui.Branding; |
||||
using Volo.Abp.DependencyInjection; |
using Volo.Abp.DependencyInjection; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
[Dependency(ReplaceServices = true)] |
||||
|
public class MyProjectNameBrandingProvider : DefaultBrandingProvider |
||||
{ |
{ |
||||
[Dependency(ReplaceServices = true)] |
public override string AppName => "MyProjectName"; |
||||
public class MyProjectNameBrandingProvider : DefaultBrandingProvider |
|
||||
{ |
|
||||
public override string AppName => "MyProjectName"; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,12 +1,11 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
public class MyProjectNameWebAutoMapperProfile : Profile |
||||
{ |
{ |
||||
public class MyProjectNameWebAutoMapperProfile : Profile |
public MyProjectNameWebAutoMapperProfile() |
||||
{ |
{ |
||||
public MyProjectNameWebAutoMapperProfile() |
//Define your AutoMapper configuration here for the Web project.
|
||||
{ |
|
||||
//Define your AutoMapper configuration here for the Web project.
|
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,18 +1,17 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Microsoft.AspNetCore.Authentication; |
using Microsoft.AspNetCore.Authentication; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Pages |
namespace MyCompanyName.MyProjectName.Pages; |
||||
|
|
||||
|
public class IndexModel : MyProjectNamePageModel |
||||
{ |
{ |
||||
public class IndexModel : MyProjectNamePageModel |
public void OnGet() |
||||
{ |
{ |
||||
public void OnGet() |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public async Task OnPostLoginAsync() |
|
||||
{ |
|
||||
await HttpContext.ChallengeAsync("oidc"); |
|
||||
} |
|
||||
} |
} |
||||
} |
|
||||
|
public async Task OnPostLoginAsync() |
||||
|
{ |
||||
|
await HttpContext.ChallengeAsync("oidc"); |
||||
|
} |
||||
|
} |
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using MyCompanyName.MyProjectName.Localization; |
using MyCompanyName.MyProjectName.Localization; |
||||
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; |
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Pages |
namespace MyCompanyName.MyProjectName.Pages; |
||||
|
|
||||
|
public abstract class MyProjectNamePageModel : AbpPageModel |
||||
{ |
{ |
||||
public abstract class MyProjectNamePageModel : AbpPageModel |
protected MyProjectNamePageModel() |
||||
{ |
{ |
||||
protected MyProjectNamePageModel() |
LocalizationResourceType = typeof(MyProjectNameResource); |
||||
{ |
|
||||
LocalizationResourceType = typeof(MyProjectNameResource); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
File diff suppressed because it is too large
@ -1,11 +1,10 @@ |
|||||
using Microsoft.AspNetCore.Mvc.RazorPages; |
using Microsoft.AspNetCore.Mvc.RazorPages; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Pages |
namespace MyCompanyName.MyProjectName.Pages; |
||||
|
|
||||
|
public class IndexModel : PageModel |
||||
{ |
{ |
||||
public class IndexModel : PageModel |
public void OnGet() |
||||
{ |
{ |
||||
public void OnGet() |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
public class MyProjectNameRemoteServiceConsts |
||||
{ |
{ |
||||
public class MyProjectNameRemoteServiceConsts |
public const string RemoteServiceName = "MyProjectName"; |
||||
{ |
|
||||
public const string RemoteServiceName = "MyProjectName"; |
|
||||
|
|
||||
public const string ModuleName = "myProjectName"; |
public const string ModuleName = "myProjectName"; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using Volo.Abp.Reflection; |
using Volo.Abp.Reflection; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Permissions |
namespace MyCompanyName.MyProjectName.Permissions; |
||||
|
|
||||
|
public class MyProjectNamePermissions |
||||
{ |
{ |
||||
public class MyProjectNamePermissions |
public const string GroupName = "MyProjectName"; |
||||
{ |
|
||||
public const string GroupName = "MyProjectName"; |
|
||||
|
|
||||
public static string[] GetAll() |
public static string[] GetAll() |
||||
{ |
{ |
||||
return ReflectionHelper.GetPublicConstantsRecursively(typeof(MyProjectNamePermissions)); |
return ReflectionHelper.GetPublicConstantsRecursively(typeof(MyProjectNamePermissions)); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,12 +1,11 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Volo.Abp.Application.Services; |
using Volo.Abp.Application.Services; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Samples |
namespace MyCompanyName.MyProjectName.Samples; |
||||
|
|
||||
|
public interface ISampleAppService : IApplicationService |
||||
{ |
{ |
||||
public interface ISampleAppService : IApplicationService |
Task<SampleDto> GetAsync(); |
||||
{ |
|
||||
Task<SampleDto> GetAsync(); |
|
||||
|
|
||||
Task<SampleDto> GetAuthorizedAsync(); |
Task<SampleDto> GetAuthorizedAsync(); |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,7 +1,6 @@ |
|||||
namespace MyCompanyName.MyProjectName.Samples |
namespace MyCompanyName.MyProjectName.Samples; |
||||
|
|
||||
|
public class SampleDto |
||||
{ |
{ |
||||
public class SampleDto |
public int Value { get; set; } |
||||
{ |
} |
||||
public int Value { get; set; } |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using MyCompanyName.MyProjectName.Localization; |
using MyCompanyName.MyProjectName.Localization; |
||||
using Volo.Abp.Application.Services; |
using Volo.Abp.Application.Services; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
public abstract class MyProjectNameAppService : ApplicationService |
||||
{ |
{ |
||||
public abstract class MyProjectNameAppService : ApplicationService |
protected MyProjectNameAppService() |
||||
{ |
{ |
||||
protected MyProjectNameAppService() |
LocalizationResource = typeof(MyProjectNameResource); |
||||
{ |
ObjectMapperContext = typeof(MyProjectNameApplicationModule); |
||||
LocalizationResource = typeof(MyProjectNameResource); |
|
||||
ObjectMapperContext = typeof(MyProjectNameApplicationModule); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
public class MyProjectNameApplicationAutoMapperProfile : Profile |
||||
{ |
{ |
||||
public class MyProjectNameApplicationAutoMapperProfile : Profile |
public MyProjectNameApplicationAutoMapperProfile() |
||||
{ |
{ |
||||
public MyProjectNameApplicationAutoMapperProfile() |
/* You can configure your AutoMapper mapping configuration here. |
||||
{ |
* Alternatively, you can split your mapping configurations |
||||
/* You can configure your AutoMapper mapping configuration here. |
* into multiple profile classes for a better organization. */ |
||||
* Alternatively, you can split your mapping configurations |
|
||||
* into multiple profile classes for a better organization. */ |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,29 +1,28 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Microsoft.AspNetCore.Authorization; |
using Microsoft.AspNetCore.Authorization; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Samples |
namespace MyCompanyName.MyProjectName.Samples; |
||||
|
|
||||
|
public class SampleAppService : MyProjectNameAppService, ISampleAppService |
||||
{ |
{ |
||||
public class SampleAppService : MyProjectNameAppService, ISampleAppService |
public Task<SampleDto> GetAsync() |
||||
{ |
{ |
||||
public Task<SampleDto> GetAsync() |
return Task.FromResult( |
||||
{ |
new SampleDto |
||||
return Task.FromResult( |
{ |
||||
new SampleDto |
Value = 42 |
||||
{ |
} |
||||
Value = 42 |
); |
||||
} |
} |
||||
); |
|
||||
} |
|
||||
|
|
||||
[Authorize] |
[Authorize] |
||||
public Task<SampleDto> GetAuthorizedAsync() |
public Task<SampleDto> GetAuthorizedAsync() |
||||
{ |
{ |
||||
return Task.FromResult( |
return Task.FromResult( |
||||
new SampleDto |
new SampleDto |
||||
{ |
{ |
||||
Value = 42 |
Value = 42 |
||||
} |
} |
||||
); |
); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using Volo.Abp.AspNetCore.Components.Server.Theming; |
using Volo.Abp.AspNetCore.Components.Server.Theming; |
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Blazor.Server |
namespace MyCompanyName.MyProjectName.Blazor.Server; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(AbpAspNetCoreComponentsServerThemingModule), |
||||
|
typeof(MyProjectNameBlazorModule) |
||||
|
)] |
||||
|
public class MyProjectNameBlazorServerModule : AbpModule |
||||
{ |
{ |
||||
[DependsOn( |
|
||||
typeof(AbpAspNetCoreComponentsServerThemingModule), |
} |
||||
typeof(MyProjectNameBlazorModule) |
|
||||
)] |
|
||||
public class MyProjectNameBlazorServerModule : AbpModule |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,15 +1,14 @@ |
|||||
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming; |
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming; |
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Blazor.WebAssembly |
namespace MyCompanyName.MyProjectName.Blazor.WebAssembly; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(MyProjectNameBlazorModule), |
||||
|
typeof(MyProjectNameHttpApiClientModule), |
||||
|
typeof(AbpAspNetCoreComponentsWebAssemblyThemingModule) |
||||
|
)] |
||||
|
public class MyProjectNameBlazorWebAssemblyModule : AbpModule |
||||
{ |
{ |
||||
[DependsOn( |
|
||||
typeof(MyProjectNameBlazorModule), |
} |
||||
typeof(MyProjectNameHttpApiClientModule), |
|
||||
typeof(AbpAspNetCoreComponentsWebAssemblyThemingModule) |
|
||||
)] |
|
||||
public class MyProjectNameBlazorWebAssemblyModule : AbpModule |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,24 +1,23 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Volo.Abp.UI.Navigation; |
using Volo.Abp.UI.Navigation; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Blazor.Menus |
namespace MyCompanyName.MyProjectName.Blazor.Menus; |
||||
|
|
||||
|
public class MyProjectNameMenuContributor : IMenuContributor |
||||
{ |
{ |
||||
public class MyProjectNameMenuContributor : IMenuContributor |
public async Task ConfigureMenuAsync(MenuConfigurationContext context) |
||||
{ |
{ |
||||
public async Task ConfigureMenuAsync(MenuConfigurationContext context) |
if (context.Menu.Name == StandardMenus.Main) |
||||
{ |
{ |
||||
if (context.Menu.Name == StandardMenus.Main) |
await ConfigureMainMenuAsync(context); |
||||
{ |
|
||||
await ConfigureMainMenuAsync(context); |
|
||||
} |
|
||||
} |
} |
||||
|
} |
||||
|
|
||||
private Task ConfigureMainMenuAsync(MenuConfigurationContext context) |
private Task ConfigureMainMenuAsync(MenuConfigurationContext context) |
||||
{ |
{ |
||||
//Add main menu items.
|
//Add main menu items.
|
||||
context.Menu.AddItem(new ApplicationMenuItem(MyProjectNameMenus.Prefix, displayName: "MyProjectName", "/MyProjectName", icon: "fa fa-globe")); |
context.Menu.AddItem(new ApplicationMenuItem(MyProjectNameMenus.Prefix, displayName: "MyProjectName", "/MyProjectName", icon: "fa fa-globe")); |
||||
|
|
||||
return Task.CompletedTask; |
return Task.CompletedTask; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,11 +1,10 @@ |
|||||
namespace MyCompanyName.MyProjectName.Blazor.Menus |
namespace MyCompanyName.MyProjectName.Blazor.Menus; |
||||
|
|
||||
|
public class MyProjectNameMenus |
||||
{ |
{ |
||||
public class MyProjectNameMenus |
public const string Prefix = "MyProjectName"; |
||||
{ |
|
||||
public const string Prefix = "MyProjectName"; |
|
||||
|
|
||||
//Add your menu items here...
|
//Add your menu items here...
|
||||
//public const string Home = Prefix + ".MyNewMenuItem";
|
//public const string Home = Prefix + ".MyNewMenuItem";
|
||||
|
|
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Blazor |
namespace MyCompanyName.MyProjectName.Blazor; |
||||
|
|
||||
|
public class MyProjectNameBlazorAutoMapperProfile : Profile |
||||
{ |
{ |
||||
public class MyProjectNameBlazorAutoMapperProfile : Profile |
public MyProjectNameBlazorAutoMapperProfile() |
||||
{ |
{ |
||||
public MyProjectNameBlazorAutoMapperProfile() |
/* You can configure your AutoMapper mapping configuration here. |
||||
{ |
* Alternatively, you can split your mapping configurations |
||||
/* You can configure your AutoMapper mapping configuration here. |
* into multiple profile classes for a better organization. */ |
||||
* Alternatively, you can split your mapping configurations |
|
||||
* into multiple profile classes for a better organization. */ |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
using Volo.Abp.Localization; |
using Volo.Abp.Localization; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Localization |
namespace MyCompanyName.MyProjectName.Localization; |
||||
|
|
||||
|
[LocalizationResourceName("MyProjectName")] |
||||
|
public class MyProjectNameResource |
||||
{ |
{ |
||||
[LocalizationResourceName("MyProjectName")] |
|
||||
public class MyProjectNameResource |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,7 +1,6 @@ |
|||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
public static class MyProjectNameErrorCodes |
||||
{ |
{ |
||||
public static class MyProjectNameErrorCodes |
//Add your business exception error codes here...
|
||||
{ |
|
||||
//Add your business exception error codes here...
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,11 +1,10 @@ |
|||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
public static class MyProjectNameDbProperties |
||||
{ |
{ |
||||
public static class MyProjectNameDbProperties |
public static string DbTablePrefix { get; set; } = "MyProjectName"; |
||||
{ |
|
||||
public static string DbTablePrefix { get; set; } = "MyProjectName"; |
|
||||
|
|
||||
public static string DbSchema { get; set; } = null; |
public static string DbSchema { get; set; } = null; |
||||
|
|
||||
public const string ConnectionStringName = "MyProjectName"; |
public const string ConnectionStringName = "MyProjectName"; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using Volo.Abp.Domain; |
using Volo.Abp.Domain; |
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(AbpDddDomainModule), |
||||
|
typeof(MyProjectNameDomainSharedModule) |
||||
|
)] |
||||
|
public class MyProjectNameDomainModule : AbpModule |
||||
{ |
{ |
||||
[DependsOn( |
|
||||
typeof(AbpDddDomainModule), |
|
||||
typeof(MyProjectNameDomainSharedModule) |
|
||||
)] |
|
||||
public class MyProjectNameDomainModule : AbpModule |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using Volo.Abp.Settings; |
using Volo.Abp.Settings; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Settings |
namespace MyCompanyName.MyProjectName.Settings; |
||||
|
|
||||
|
public class MyProjectNameSettingDefinitionProvider : SettingDefinitionProvider |
||||
{ |
{ |
||||
public class MyProjectNameSettingDefinitionProvider : SettingDefinitionProvider |
public override void Define(ISettingDefinitionContext context) |
||||
{ |
{ |
||||
public override void Define(ISettingDefinitionContext context) |
/* Define module settings here. |
||||
{ |
* Use names from MyProjectNameSettings class. |
||||
/* Define module settings here. |
*/ |
||||
* Use names from MyProjectNameSettings class. |
|
||||
*/ |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,11 +1,10 @@ |
|||||
namespace MyCompanyName.MyProjectName.Settings |
namespace MyCompanyName.MyProjectName.Settings; |
||||
|
|
||||
|
public static class MyProjectNameSettings |
||||
{ |
{ |
||||
public static class MyProjectNameSettings |
public const string GroupName = "MyProjectName"; |
||||
{ |
|
||||
public const string GroupName = "MyProjectName"; |
|
||||
|
|
||||
/* Add constants for setting names. Example: |
/* Add constants for setting names. Example: |
||||
* public const string MySettingName = GroupName + ".MySettingName"; |
* public const string MySettingName = GroupName + ".MySettingName"; |
||||
*/ |
*/ |
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using Volo.Abp.Data; |
using Volo.Abp.Data; |
||||
using Volo.Abp.EntityFrameworkCore; |
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.EntityFrameworkCore |
namespace MyCompanyName.MyProjectName.EntityFrameworkCore; |
||||
|
|
||||
|
[ConnectionStringName(MyProjectNameDbProperties.ConnectionStringName)] |
||||
|
public interface IMyProjectNameDbContext : IEfCoreDbContext |
||||
{ |
{ |
||||
[ConnectionStringName(MyProjectNameDbProperties.ConnectionStringName)] |
/* Add DbSet for each Aggregate Root here. Example: |
||||
public interface IMyProjectNameDbContext : IEfCoreDbContext |
* DbSet<Question> Questions { get; } |
||||
{ |
*/ |
||||
/* Add DbSet for each Aggregate Root here. Example: |
} |
||||
* DbSet<Question> Questions { get; } |
|
||||
*/ |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,34 +1,33 @@ |
|||||
using Microsoft.EntityFrameworkCore; |
using Microsoft.EntityFrameworkCore; |
||||
using Volo.Abp; |
using Volo.Abp; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.EntityFrameworkCore |
namespace MyCompanyName.MyProjectName.EntityFrameworkCore; |
||||
|
|
||||
|
public static class MyProjectNameDbContextModelCreatingExtensions |
||||
{ |
{ |
||||
public static class MyProjectNameDbContextModelCreatingExtensions |
public static void ConfigureMyProjectName( |
||||
|
this ModelBuilder builder) |
||||
{ |
{ |
||||
public static void ConfigureMyProjectName( |
Check.NotNull(builder, nameof(builder)); |
||||
this ModelBuilder builder) |
|
||||
{ |
|
||||
Check.NotNull(builder, nameof(builder)); |
|
||||
|
|
||||
/* Configure all entities here. Example: |
/* Configure all entities here. Example: |
||||
|
|
||||
builder.Entity<Question>(b => |
builder.Entity<Question>(b => |
||||
{ |
{ |
||||
//Configure table & schema name
|
//Configure table & schema name
|
||||
b.ToTable(MyProjectNameDbProperties.DbTablePrefix + "Questions", MyProjectNameDbProperties.DbSchema); |
b.ToTable(MyProjectNameDbProperties.DbTablePrefix + "Questions", MyProjectNameDbProperties.DbSchema); |
||||
|
|
||||
b.ConfigureByConvention(); |
b.ConfigureByConvention(); |
||||
|
|
||||
//Properties
|
//Properties
|
||||
b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); |
b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); |
||||
|
|
||||
//Relations
|
//Relations
|
||||
b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); |
b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); |
||||
|
|
||||
//Indexes
|
//Indexes
|
||||
b.HasIndex(q => q.CreationTime); |
b.HasIndex(q => q.CreationTime); |
||||
}); |
}); |
||||
*/ |
*/ |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using MyCompanyName.MyProjectName.Localization; |
using MyCompanyName.MyProjectName.Localization; |
||||
using Volo.Abp.AspNetCore.Mvc; |
using Volo.Abp.AspNetCore.Mvc; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
public abstract class MyProjectNameController : AbpControllerBase |
||||
{ |
{ |
||||
public abstract class MyProjectNameController : AbpControllerBase |
protected MyProjectNameController() |
||||
{ |
{ |
||||
protected MyProjectNameController() |
LocalizationResource = typeof(MyProjectNameResource); |
||||
{ |
|
||||
LocalizationResource = typeof(MyProjectNameResource); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using Volo.Abp.Data; |
using Volo.Abp.Data; |
||||
using Volo.Abp.MongoDB; |
using Volo.Abp.MongoDB; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.MongoDB |
namespace MyCompanyName.MyProjectName.MongoDB; |
||||
|
|
||||
|
[ConnectionStringName(MyProjectNameDbProperties.ConnectionStringName)] |
||||
|
public interface IMyProjectNameMongoDbContext : IAbpMongoDbContext |
||||
{ |
{ |
||||
[ConnectionStringName(MyProjectNameDbProperties.ConnectionStringName)] |
/* Define mongo collections here. Example: |
||||
public interface IMyProjectNameMongoDbContext : IAbpMongoDbContext |
* IMongoCollection<Question> Questions { get; } |
||||
{ |
*/ |
||||
/* Define mongo collections here. Example: |
|
||||
* IMongoCollection<Question> Questions { get; } |
|
||||
*/ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,20 +1,19 @@ |
|||||
using Volo.Abp.Data; |
using Volo.Abp.Data; |
||||
using Volo.Abp.MongoDB; |
using Volo.Abp.MongoDB; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.MongoDB |
namespace MyCompanyName.MyProjectName.MongoDB; |
||||
|
|
||||
|
[ConnectionStringName(MyProjectNameDbProperties.ConnectionStringName)] |
||||
|
public class MyProjectNameMongoDbContext : AbpMongoDbContext, IMyProjectNameMongoDbContext |
||||
{ |
{ |
||||
[ConnectionStringName(MyProjectNameDbProperties.ConnectionStringName)] |
/* Add mongo collections here. Example: |
||||
public class MyProjectNameMongoDbContext : AbpMongoDbContext, IMyProjectNameMongoDbContext |
* public IMongoCollection<Question> Questions => Collection<Question>(); |
||||
{ |
*/ |
||||
/* Add mongo collections here. Example: |
|
||||
* public IMongoCollection<Question> Questions => Collection<Question>(); |
|
||||
*/ |
|
||||
|
|
||||
protected override void CreateModel(IMongoModelBuilder modelBuilder) |
protected override void CreateModel(IMongoModelBuilder modelBuilder) |
||||
{ |
{ |
||||
base.CreateModel(modelBuilder); |
base.CreateModel(modelBuilder); |
||||
|
|
||||
modelBuilder.ConfigureMyProjectName(); |
modelBuilder.ConfigureMyProjectName(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using Volo.Abp; |
using Volo.Abp; |
||||
using Volo.Abp.MongoDB; |
using Volo.Abp.MongoDB; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.MongoDB |
namespace MyCompanyName.MyProjectName.MongoDB; |
||||
|
|
||||
|
public static class MyProjectNameMongoDbContextExtensions |
||||
{ |
{ |
||||
public static class MyProjectNameMongoDbContextExtensions |
public static void ConfigureMyProjectName( |
||||
|
this IMongoModelBuilder builder) |
||||
{ |
{ |
||||
public static void ConfigureMyProjectName( |
Check.NotNull(builder, nameof(builder)); |
||||
this IMongoModelBuilder builder) |
|
||||
{ |
|
||||
Check.NotNull(builder, nameof(builder)); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,24 +1,23 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Volo.Abp.UI.Navigation; |
using Volo.Abp.UI.Navigation; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Web.Menus |
namespace MyCompanyName.MyProjectName.Web.Menus; |
||||
|
|
||||
|
public class MyProjectNameMenuContributor : IMenuContributor |
||||
{ |
{ |
||||
public class MyProjectNameMenuContributor : IMenuContributor |
public async Task ConfigureMenuAsync(MenuConfigurationContext context) |
||||
{ |
{ |
||||
public async Task ConfigureMenuAsync(MenuConfigurationContext context) |
if (context.Menu.Name == StandardMenus.Main) |
||||
{ |
{ |
||||
if (context.Menu.Name == StandardMenus.Main) |
await ConfigureMainMenuAsync(context); |
||||
{ |
|
||||
await ConfigureMainMenuAsync(context); |
|
||||
} |
|
||||
} |
} |
||||
|
} |
||||
|
|
||||
private Task ConfigureMainMenuAsync(MenuConfigurationContext context) |
private Task ConfigureMainMenuAsync(MenuConfigurationContext context) |
||||
{ |
{ |
||||
//Add main menu items.
|
//Add main menu items.
|
||||
context.Menu.AddItem(new ApplicationMenuItem(MyProjectNameMenus.Prefix, displayName: "MyProjectName", "~/MyProjectName", icon: "fa fa-globe")); |
context.Menu.AddItem(new ApplicationMenuItem(MyProjectNameMenus.Prefix, displayName: "MyProjectName", "~/MyProjectName", icon: "fa fa-globe")); |
||||
|
|
||||
return Task.CompletedTask; |
return Task.CompletedTask; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,11 +1,10 @@ |
|||||
namespace MyCompanyName.MyProjectName.Web.Menus |
namespace MyCompanyName.MyProjectName.Web.Menus; |
||||
|
|
||||
|
public class MyProjectNameMenus |
||||
{ |
{ |
||||
public class MyProjectNameMenus |
public const string Prefix = "MyProjectName"; |
||||
{ |
|
||||
public const string Prefix = "MyProjectName"; |
|
||||
|
|
||||
//Add your menu items here...
|
//Add your menu items here...
|
||||
//public const string Home = Prefix + ".MyNewMenuItem";
|
//public const string Home = Prefix + ".MyNewMenuItem";
|
||||
|
|
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Web |
namespace MyCompanyName.MyProjectName.Web; |
||||
|
|
||||
|
public class MyProjectNameWebAutoMapperProfile : Profile |
||||
{ |
{ |
||||
public class MyProjectNameWebAutoMapperProfile : Profile |
public MyProjectNameWebAutoMapperProfile() |
||||
{ |
{ |
||||
public MyProjectNameWebAutoMapperProfile() |
/* You can configure your AutoMapper mapping configuration here. |
||||
{ |
* Alternatively, you can split your mapping configurations |
||||
/* You can configure your AutoMapper mapping configuration here. |
* into multiple profile classes for a better organization. */ |
||||
* Alternatively, you can split your mapping configurations |
|
||||
* into multiple profile classes for a better organization. */ |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
namespace MyCompanyName.MyProjectName.Web.Pages.MyProjectName |
namespace MyCompanyName.MyProjectName.Web.Pages.MyProjectName; |
||||
|
|
||||
|
public class IndexModel : MyProjectNamePageModel |
||||
{ |
{ |
||||
public class IndexModel : MyProjectNamePageModel |
public void OnGet() |
||||
{ |
{ |
||||
public void OnGet() |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,16 +1,15 @@ |
|||||
using MyCompanyName.MyProjectName.Localization; |
using MyCompanyName.MyProjectName.Localization; |
||||
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; |
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Web.Pages |
namespace MyCompanyName.MyProjectName.Web.Pages; |
||||
|
|
||||
|
/* Inherit your PageModel classes from this class. |
||||
|
*/ |
||||
|
public abstract class MyProjectNamePageModel : AbpPageModel |
||||
{ |
{ |
||||
/* Inherit your PageModel classes from this class. |
protected MyProjectNamePageModel() |
||||
*/ |
|
||||
public abstract class MyProjectNamePageModel : AbpPageModel |
|
||||
{ |
{ |
||||
protected MyProjectNamePageModel() |
LocalizationResourceType = typeof(MyProjectNameResource); |
||||
{ |
ObjectMapperContext = typeof(MyProjectNameWebModule); |
||||
LocalizationResourceType = typeof(MyProjectNameResource); |
|
||||
ObjectMapperContext = typeof(MyProjectNameWebModule); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
/* Inherit from this class for your application layer tests. |
||||
|
* See SampleAppService_Tests for example. |
||||
|
*/ |
||||
|
public abstract class MyProjectNameApplicationTestBase : MyProjectNameTestBase<MyProjectNameApplicationTestModule> |
||||
{ |
{ |
||||
/* Inherit from this class for your application layer tests. |
|
||||
* See SampleAppService_Tests for example. |
|
||||
*/ |
|
||||
public abstract class MyProjectNameApplicationTestBase : MyProjectNameTestBase<MyProjectNameApplicationTestModule> |
|
||||
{ |
|
||||
|
|
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(MyProjectNameApplicationModule), |
||||
|
typeof(MyProjectNameDomainTestModule) |
||||
|
)] |
||||
|
public class MyProjectNameApplicationTestModule : AbpModule |
||||
{ |
{ |
||||
[DependsOn( |
|
||||
typeof(MyProjectNameApplicationModule), |
|
||||
typeof(MyProjectNameDomainTestModule) |
|
||||
)] |
|
||||
public class MyProjectNameApplicationTestModule : AbpModule |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
/* Inherit from this class for your domain layer tests. |
||||
|
* See SampleManager_Tests for example. |
||||
|
*/ |
||||
|
public abstract class MyProjectNameDomainTestBase : MyProjectNameTestBase<MyProjectNameDomainTestModule> |
||||
{ |
{ |
||||
/* Inherit from this class for your domain layer tests. |
|
||||
* See SampleManager_Tests for example. |
|
||||
*/ |
|
||||
public abstract class MyProjectNameDomainTestBase : MyProjectNameTestBase<MyProjectNameDomainTestModule> |
|
||||
{ |
|
||||
|
|
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,17 +1,16 @@ |
|||||
using MyCompanyName.MyProjectName.EntityFrameworkCore; |
using MyCompanyName.MyProjectName.EntityFrameworkCore; |
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
|
/* Domain tests are configured to use the EF Core provider. |
||||
|
* You can switch to MongoDB, however your domain tests should be |
||||
|
* database independent anyway. |
||||
|
*/ |
||||
|
[DependsOn( |
||||
|
typeof(MyProjectNameEntityFrameworkCoreTestModule) |
||||
|
)] |
||||
|
public class MyProjectNameDomainTestModule : AbpModule |
||||
{ |
{ |
||||
/* Domain tests are configured to use the EF Core provider. |
|
||||
* You can switch to MongoDB, however your domain tests should be |
|
||||
* database independent anyway. |
|
||||
*/ |
|
||||
[DependsOn( |
|
||||
typeof(MyProjectNameEntityFrameworkCoreTestModule) |
|
||||
)] |
|
||||
public class MyProjectNameDomainTestModule : AbpModule |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,21 +1,20 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Xunit; |
using Xunit; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Samples |
namespace MyCompanyName.MyProjectName.Samples; |
||||
|
|
||||
|
public class SampleManager_Tests : MyProjectNameDomainTestBase |
||||
{ |
{ |
||||
public class SampleManager_Tests : MyProjectNameDomainTestBase |
//private readonly SampleManager _sampleManager;
|
||||
{ |
|
||||
//private readonly SampleManager _sampleManager;
|
|
||||
|
|
||||
public SampleManager_Tests() |
public SampleManager_Tests() |
||||
{ |
{ |
||||
//_sampleManager = GetRequiredService<SampleManager>();
|
//_sampleManager = GetRequiredService<SampleManager>();
|
||||
} |
} |
||||
|
|
||||
[Fact] |
[Fact] |
||||
public async Task Method1Async() |
public async Task Method1Async() |
||||
{ |
{ |
||||
|
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
namespace MyCompanyName.MyProjectName.EntityFrameworkCore |
namespace MyCompanyName.MyProjectName.EntityFrameworkCore; |
||||
|
|
||||
|
/* This class can be used as a base class for EF Core integration tests, |
||||
|
* while SampleRepository_Tests uses a different approach. |
||||
|
*/ |
||||
|
public abstract class MyProjectNameEntityFrameworkCoreTestBase : MyProjectNameTestBase<MyProjectNameEntityFrameworkCoreTestModule> |
||||
{ |
{ |
||||
/* This class can be used as a base class for EF Core integration tests, |
|
||||
* while SampleRepository_Tests uses a different approach. |
|
||||
*/ |
|
||||
public abstract class MyProjectNameEntityFrameworkCoreTestBase : MyProjectNameTestBase<MyProjectNameEntityFrameworkCoreTestModule> |
|
||||
{ |
|
||||
|
|
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,12 +1,11 @@ |
|||||
using MyCompanyName.MyProjectName.Samples; |
using MyCompanyName.MyProjectName.Samples; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.EntityFrameworkCore.Samples |
namespace MyCompanyName.MyProjectName.EntityFrameworkCore.Samples; |
||||
|
|
||||
|
public class SampleRepository_Tests : SampleRepository_Tests<MyProjectNameEntityFrameworkCoreTestModule> |
||||
{ |
{ |
||||
public class SampleRepository_Tests : SampleRepository_Tests<MyProjectNameEntityFrameworkCoreTestModule> |
/* Don't write custom repository tests here, instead write to |
||||
{ |
* the base class. |
||||
/* Don't write custom repository tests here, instead write to |
* One exception can be some specific tests related to EF core. |
||||
* the base class. |
*/ |
||||
* One exception can be some specific tests related to EF core. |
|
||||
*/ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue