Browse Source

Upgrade bookstore application to ABP v0.4.1.

pull/400/head
Halil ibrahim Kalkan 8 years ago
parent
commit
eaf6b9c8a2
  1. 3
      docs/Tutorials/AspNetCore-Mvc/Part-I.md
  2. 3
      docs/Tutorials/AspNetCore-Mvc/Part-II.md
  3. 2
      samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj
  4. 2
      samples/BookStore/src/Acme.BookStore.Application/CreateUpdateBookDto.cs
  5. 2
      samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj
  6. 8
      samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj
  7. 8
      samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj
  8. 23
      samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs
  9. 4
      samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj
  10. 2
      samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj

3
docs/Tutorials/AspNetCore-Mvc/Part-I.md

@ -159,10 +159,13 @@ namespace Acme.BookStore
[StringLength(128)] [StringLength(128)]
public string Name { get; set; } public string Name { get; set; }
[Required]
public BookType Type { get; set; } = BookType.Undefined; public BookType Type { get; set; } = BookType.Undefined;
[Required]
public DateTime PublishDate { get; set; } public DateTime PublishDate { get; set; }
[Required]
public float Price { get; set; } public float Price { get; set; }
} }
} }

3
docs/Tutorials/AspNetCore-Mvc/Part-II.md

@ -199,10 +199,13 @@ namespace Acme.BookStore
[StringLength(128)] [StringLength(128)]
public string Name { get; set; } public string Name { get; set; }
[Required]
public BookType Type { get; set; } = BookType.Undefined; public BookType Type { get; set; } = BookType.Undefined;
[Required]
public DateTime PublishDate { get; set; } public DateTime PublishDate { get; set; }
[Required]
public float Price { get; set; } public float Price { get; set; }
} }
} }

2
samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj

@ -7,7 +7,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj" /> <ProjectReference Include="..\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="0.3.7" /> <PackageReference Include="Volo.Abp.Identity.Application" Version="0.4.1" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
samples/BookStore/src/Acme.BookStore.Application/CreateUpdateBookDto.cs

@ -14,8 +14,10 @@ namespace Acme.BookStore
public BookType Type { get; set; } = BookType.Undefined; public BookType Type { get; set; } = BookType.Undefined;
[Required]
public DateTime PublishDate { get; set; } public DateTime PublishDate { get; set; }
[Required]
public float Price { get; set; } public float Price { get; set; }
} }
} }

2
samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj

@ -6,7 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Domain" Version="0.3.7" /> <PackageReference Include="Volo.Abp.Identity.Domain" Version="0.4.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.1.1" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.1.1" />
</ItemGroup> </ItemGroup>

8
samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj

@ -12,10 +12,10 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj" /> <ProjectReference Include="..\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.3.7" /> <PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.4.1" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.3.7" /> <PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.4.1" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="0.3.7" /> <PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="0.4.1" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.3.7" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.4.1" />
</ItemGroup> </ItemGroup>
</Project> </Project>

8
samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj

@ -27,10 +27,10 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Acme.BookStore.Application\Acme.BookStore.Application.csproj" /> <ProjectReference Include="..\Acme.BookStore.Application\Acme.BookStore.Application.csproj" />
<ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore\Acme.BookStore.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore\Acme.BookStore.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="0.3.7" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="0.4.1" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.3.7" /> <PackageReference Include="Volo.Abp.Autofac" Version="0.4.1" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="0.3.7" /> <PackageReference Include="Volo.Abp.Identity.Web" Version="0.4.1" />
<PackageReference Include="Volo.Abp.Account.Web" Version="0.3.7" /> <PackageReference Include="Volo.Abp.Account.Web" Version="0.4.1" />
</ItemGroup> </ItemGroup>
</Project> </Project>

23
samples/BookStore/src/Acme.BookStore.Web/BookStoreWebModule.cs

@ -1,13 +1,9 @@
using System.Collections.Generic; using System.IO;
using System.Globalization;
using System.IO;
using Localization.Resources.AbpUi; using Localization.Resources.AbpUi;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Localization;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Acme.BookStore.EntityFrameworkCore; using Acme.BookStore.EntityFrameworkCore;
using Acme.BookStore.Localization.BookStore; using Acme.BookStore.Localization.BookStore;
using Acme.BookStore.Menus; using Acme.BookStore.Menus;
@ -17,8 +13,6 @@ using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Modularity; using Volo.Abp.AspNetCore.Modularity;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
@ -30,9 +24,7 @@ using Volo.Abp.Identity.Web;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Localization.Resources.AbpValidation; using Volo.Abp.Localization.Resources.AbpValidation;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.Web;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.UI;
using Volo.Abp.UI.Navigation; using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem; using Volo.Abp.VirtualFileSystem;
@ -109,14 +101,6 @@ namespace Acme.BookStore
private static void ConfigureLocalizationServices(IServiceCollection services) private static void ConfigureLocalizationServices(IServiceCollection services)
{ {
var cultures = new List<CultureInfo> {new CultureInfo("en"), new CultureInfo("tr")};
services.Configure<RequestLocalizationOptions>(options =>
{
options.DefaultRequestCulture = new RequestCulture("en");
options.SupportedCultures = cultures;
options.SupportedUICultures = cultures;
});
services.Configure<AbpLocalizationOptions>(options => services.Configure<AbpLocalizationOptions>(options =>
{ {
options.Resources options.Resources
@ -125,6 +109,9 @@ namespace Acme.BookStore
typeof(AbpValidationResource), typeof(AbpValidationResource),
typeof(AbpUiResource) typeof(AbpUiResource)
); );
options.Languages.Add(new LanguageInfo("en", "en", "English"));
options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe"));
}); });
} }
@ -171,7 +158,7 @@ namespace Acme.BookStore
app.UseVirtualFiles(); app.UseVirtualFiles();
app.UseAuthentication(); app.UseAuthentication();
app.UseRequestLocalization(app.ApplicationServices.GetRequiredService<IOptions<RequestLocalizationOptions>>().Value); app.UseAbpRequestLocalization();
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI(options => app.UseSwaggerUI(options =>

4
samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj

@ -8,8 +8,8 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Acme.BookStore.Application\Acme.BookStore.Application.csproj" /> <ProjectReference Include="..\..\src\Acme.BookStore.Application\Acme.BookStore.Application.csproj" />
<ProjectReference Include="..\..\src\Acme.BookStore.EntityFrameworkCore\Acme.BookStore.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\src\Acme.BookStore.EntityFrameworkCore\Acme.BookStore.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.TestBase" Version="0.3.7" /> <PackageReference Include="Volo.Abp.TestBase" Version="0.4.1" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.3.7" /> <PackageReference Include="Volo.Abp.Autofac" Version="0.4.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

2
samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj

@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<ProjectReference Include="..\Acme.BookStore.Application.Tests\Acme.BookStore.Application.Tests.csproj" /> <ProjectReference Include="..\Acme.BookStore.Application.Tests\Acme.BookStore.Application.Tests.csproj" />
<ProjectReference Include="..\..\src\Acme.BookStore.Web\Acme.BookStore.Web.csproj" /> <ProjectReference Include="..\..\src\Acme.BookStore.Web\Acme.BookStore.Web.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.TestBase" Version="0.3.7" /> <PackageReference Include="Volo.Abp.AspNetCore.TestBase" Version="0.4.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

Loading…
Cancel
Save