diff --git a/docs/Getting-Started-AspNetCore-Application.md b/docs/Getting-Started-AspNetCore-Application.md index 32c3de4eab..46b1c21443 100644 --- a/docs/Getting-Started-AspNetCore-Application.md +++ b/docs/Getting-Started-AspNetCore-Application.md @@ -125,7 +125,7 @@ namespace BasicAspNetCoreApplication.Controllers If you run the application, you will see a "Hello World!" message on the page. -Devided ``HomeController`` from ``AbpController`` instead of standard ``Controller`` class. This is not required, but ``AbpController`` class has useful base properties and methods to make your development easier. +Derived ``HomeController`` from ``AbpController`` instead of standard ``Controller`` class. This is not required, but ``AbpController`` class has useful base properties and methods to make your development easier. ### Using Autofac as Dependency Injection Framework diff --git a/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll b/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll index 9b260304f6..629eb6cda8 100644 Binary files a/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll and b/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll differ diff --git a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs index b06cefdcd1..3f8f3ef284 100644 --- a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs +++ b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs @@ -28,8 +28,6 @@ namespace Volo.Abp.AspNetCore.Mvc { public override void ConfigureServices(IServiceCollection services) { - services.AddAssemblyOf(); - //Configure Razor services.Insert(0, ServiceDescriptor.Singleton>( @@ -59,6 +57,8 @@ namespace Volo.Abp.AspNetCore.Mvc o.RootPath = "abp"; }); }); + + services.AddAssemblyOf(); } public override void PostConfigureServices(IServiceCollection services) diff --git a/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs b/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs index 5e2e8e2986..4f8bc25beb 100644 --- a/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs +++ b/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs @@ -20,7 +20,8 @@ namespace Volo.Abp.AspNetCore.Mvc { public override void ConfigureServices(IServiceCollection services) { - services.AddMvc(); + services.AddLocalization(); //TODO: Move to AbpAspNetCoreMvcModule + services.AddMvc(); //TODO: Move to AbpAspNetCoreMvcModule services.Configure(options => { diff --git a/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AspNetCoreMvcTestBase.cs b/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AspNetCoreMvcTestBase.cs index de69775fd5..ee5165e4f4 100644 --- a/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AspNetCoreMvcTestBase.cs +++ b/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AspNetCoreMvcTestBase.cs @@ -1,8 +1,6 @@ -using System; using System.IO; using System.Linq; using Microsoft.AspNetCore.Hosting; -using Volo.Abp.AspNetCore.App; namespace Volo.Abp.AspNetCore.Mvc { diff --git a/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/MvcLocalization_Tests.cs b/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/MvcLocalization_Tests.cs new file mode 100644 index 0000000000..59d9bcbac4 --- /dev/null +++ b/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/MvcLocalization_Tests.cs @@ -0,0 +1,25 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Localization; +using Shouldly; +using Xunit; + +namespace Volo.Abp.AspNetCore.Mvc.Localization +{ + public class MvcLocalization_Tests : AspNetCoreMvcTestBase + { + private readonly IStringLocalizer _localizer; + + public MvcLocalization_Tests() + { + _localizer = ServiceProvider.GetRequiredService>(); + } + + [Fact] + public void Should_Get_Same_Text_If_Not_Defined() + { + const string text = "A string that is not defined!"; + + _localizer[text].Value.ShouldBe(text); + } + } +}