Browse Source

Upgrade BookStore to v0.8.0.

pull/625/head
Halil ibrahim Kalkan 8 years ago
parent
commit
59b5e68eeb
  1. 2
      samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj
  2. 15
      samples/BookStore/src/Acme.BookStore.Application/BookAppService.cs
  3. 2
      samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj
  4. 13
      samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj
  5. 65
      samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181204060805_Initial.Designer.cs
  6. 40
      samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181204060805_Initial.cs
  7. 104
      samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181204060902_Created_Book_Entity.Designer.cs
  8. 0
      samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181204060902_Created_Book_Entity.cs
  9. 65
      samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/BookStoreDbContextModelSnapshot.cs
  10. 8
      samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj
  11. 4
      samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj
  12. 2
      samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj

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

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

15
samples/BookStore/src/Acme.BookStore.Application/BookAppService.cs

@ -1,4 +1,5 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
@ -15,5 +16,19 @@ namespace Acme.BookStore
{
}
public override async Task<BookDto> UpdateAsync(Guid id, CreateUpdateBookDto input)
{
await CheckUpdatePolicyAsync();
var entity = await GetEntityByIdAsync(id);
//TODO: Check if input has id different than given id and normalize if it's default value, throw ex otherwise
MapToEntity(input, entity);
await CurrentUnitOfWork.SaveChangesAsync();
return MapToEntityDto(entity);
}
}
}

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

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

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

@ -5,6 +5,11 @@
<RootNamespace>Acme.BookStore</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Migrations\20180528221424_Initial.cs" />
<Compile Remove="Migrations\20180703184727_Created_Book_Entity.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.1" />
@ -12,10 +17,10 @@
<ItemGroup>
<ProjectReference Include="..\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.4.1" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.4.1" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="0.4.1" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.4.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.8.0" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.8.0" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="0.8.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.8.0" />
</ItemGroup>
</Project>

65
samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180703184727_Created_Book_Entity.Designer.cs → samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181204060805_Initial.Designer.cs

@ -10,8 +10,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Acme.BookStore.Migrations
{
[DbContext(typeof(BookStoreDbContext))]
[Migration("20180703184727_Created_Book_Entity")]
partial class Created_Book_Entity
[Migration("20181204060805_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
@ -21,32 +21,33 @@ namespace Acme.BookStore.Migrations
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Acme.BookStore.Book", b =>
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<Guid?>("CreatorId");
b.Property<DateTime?>("LastModificationTime");
b.Property<string>("Description")
.HasMaxLength(256);
b.Property<Guid?>("LastModifierId");
b.Property<bool>("IsStatic");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
.HasMaxLength(256);
b.Property<float>("Price");
b.Property<string>("Regex")
.HasMaxLength(512);
b.Property<DateTime>("PublishDate");
b.Property<string>("RegexDescription")
.HasMaxLength(128);
b.Property<bool>("Required");
b.Property<byte>("Type");
b.Property<int>("ValueType");
b.HasKey("Id");
b.ToTable("Books");
b.ToTable("AbpClaimTypes");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
@ -56,6 +57,15 @@ namespace Acme.BookStore.Migrations
b.Property<string>("ConcurrencyStamp");
b.Property<bool>("IsDefault")
.HasColumnName("IsDefault");
b.Property<bool>("IsPublic")
.HasColumnName("IsPublic");
b.Property<bool>("IsStatic")
.HasColumnName("IsStatic");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256);
@ -111,6 +121,14 @@ namespace Acme.BookStore.Migrations
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(256);
b.Property<DateTime>("CreationTime");
b.Property<Guid?>("CreatorId");
b.Property<Guid?>("DeleterId");
b.Property<DateTime?>("DeletionTime");
b.Property<string>("Email")
.HasColumnName("Email")
.HasMaxLength(256);
@ -123,6 +141,12 @@ namespace Acme.BookStore.Migrations
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted");
b.Property<DateTime?>("LastModificationTime");
b.Property<Guid?>("LastModifierId");
b.Property<bool>("LockoutEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("LockoutEnabled")
@ -130,6 +154,10 @@ namespace Acme.BookStore.Migrations
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("Name")
.HasColumnName("Name")
.HasMaxLength(64);
b.Property<string>("NormalizedEmail")
.HasColumnName("NormalizedEmail")
.HasMaxLength(256);
@ -157,6 +185,10 @@ namespace Acme.BookStore.Migrations
.HasColumnName("SecurityStamp")
.HasMaxLength(256);
b.Property<string>("Surname")
.HasColumnName("Surname")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
@ -249,9 +281,10 @@ namespace Acme.BookStore.Migrations
b.Property<Guid>("UserId");
b.Property<string>("LoginProvider")
.HasMaxLength(128);
.HasMaxLength(64);
b.Property<string>("Name");
b.Property<string>("Name")
.HasMaxLength(128);
b.Property<Guid?>("TenantId");

40
samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180528221424_Initial.cs → samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181204060805_Initial.cs

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Acme.BookStore.Migrations
@ -8,6 +7,24 @@ namespace Acme.BookStore.Migrations
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpClaimTypes",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 256, nullable: false),
Required = table.Column<bool>(nullable: false),
IsStatic = table.Column<bool>(nullable: false),
Regex = table.Column<string>(maxLength: 512, nullable: true),
RegexDescription = table.Column<string>(maxLength: 128, nullable: true),
Description = table.Column<string>(maxLength: 256, nullable: true),
ValueType = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissionGrants",
columns: table => new
@ -31,7 +48,10 @@ namespace Acme.BookStore.Migrations
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 256, nullable: false),
NormalizedName = table.Column<string>(maxLength: 256, nullable: false),
ConcurrencyStamp = table.Column<string>(nullable: true)
ConcurrencyStamp = table.Column<string>(nullable: true),
IsDefault = table.Column<bool>(nullable: false),
IsStatic = table.Column<bool>(nullable: false),
IsPublic = table.Column<bool>(nullable: false)
},
constraints: table =>
{
@ -58,9 +78,18 @@ namespace Acme.BookStore.Migrations
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserName = table.Column<string>(maxLength: 256, nullable: false),
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: false),
Name = table.Column<string>(maxLength: 64, nullable: true),
Surname = table.Column<string>(maxLength: 64, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
@ -174,8 +203,8 @@ namespace Acme.BookStore.Migrations
{
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
LoginProvider = table.Column<string>(maxLength: 128, nullable: false),
Name = table.Column<string>(nullable: false),
LoginProvider = table.Column<string>(maxLength: 64, nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
@ -247,6 +276,9 @@ namespace Acme.BookStore.Migrations
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpClaimTypes");
migrationBuilder.DropTable(
name: "AbpPermissionGrants");

104
samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180528221424_Initial.Designer.cs → samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181204060902_Created_Book_Entity.Designer.cs

@ -1,27 +1,83 @@
// <auto-generated />
using System;
using System.Collections.Generic;
using Acme.BookStore.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Acme.BookStore.EntityFrameworkCore;
namespace Acme.BookStore.Migrations
{
[DbContext(typeof(BookStoreDbContext))]
[Migration("20180528221424_Initial")]
partial class Initial
[Migration("20181204060902_Created_Book_Entity")]
partial class Created_Book_Entity
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.1.0-preview2-30571")
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Acme.BookStore.Book", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<Guid?>("CreatorId");
b.Property<DateTime?>("LastModificationTime");
b.Property<Guid?>("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<float>("Price");
b.Property<DateTime>("PublishDate");
b.Property<byte>("Type");
b.HasKey("Id");
b.ToTable("Books");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Description")
.HasMaxLength(256);
b.Property<bool>("IsStatic");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("Regex")
.HasMaxLength(512);
b.Property<string>("RegexDescription")
.HasMaxLength(128);
b.Property<bool>("Required");
b.Property<int>("ValueType");
b.HasKey("Id");
b.ToTable("AbpClaimTypes");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
{
b.Property<Guid>("Id")
@ -29,6 +85,15 @@ namespace Acme.BookStore.Migrations
b.Property<string>("ConcurrencyStamp");
b.Property<bool>("IsDefault")
.HasColumnName("IsDefault");
b.Property<bool>("IsPublic")
.HasColumnName("IsPublic");
b.Property<bool>("IsStatic")
.HasColumnName("IsStatic");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256);
@ -84,6 +149,14 @@ namespace Acme.BookStore.Migrations
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(256);
b.Property<DateTime>("CreationTime");
b.Property<Guid?>("CreatorId");
b.Property<Guid?>("DeleterId");
b.Property<DateTime?>("DeletionTime");
b.Property<string>("Email")
.HasColumnName("Email")
.HasMaxLength(256);
@ -96,6 +169,12 @@ namespace Acme.BookStore.Migrations
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted");
b.Property<DateTime?>("LastModificationTime");
b.Property<Guid?>("LastModifierId");
b.Property<bool>("LockoutEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("LockoutEnabled")
@ -103,6 +182,10 @@ namespace Acme.BookStore.Migrations
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("Name")
.HasColumnName("Name")
.HasMaxLength(64);
b.Property<string>("NormalizedEmail")
.HasColumnName("NormalizedEmail")
.HasMaxLength(256);
@ -130,6 +213,10 @@ namespace Acme.BookStore.Migrations
.HasColumnName("SecurityStamp")
.HasMaxLength(256);
b.Property<string>("Surname")
.HasColumnName("Surname")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
@ -222,9 +309,10 @@ namespace Acme.BookStore.Migrations
b.Property<Guid>("UserId");
b.Property<string>("LoginProvider")
.HasMaxLength(128);
.HasMaxLength(64);
b.Property<string>("Name");
b.Property<string>("Name")
.HasMaxLength(128);
b.Property<Guid?>("TenantId");

0
samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20180703184727_Created_Book_Entity.cs → samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181204060902_Created_Book_Entity.cs

65
samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/BookStoreDbContextModelSnapshot.cs

@ -47,6 +47,35 @@ namespace Acme.BookStore.Migrations
b.ToTable("Books");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Description")
.HasMaxLength(256);
b.Property<bool>("IsStatic");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("Regex")
.HasMaxLength(512);
b.Property<string>("RegexDescription")
.HasMaxLength(128);
b.Property<bool>("Required");
b.Property<int>("ValueType");
b.HasKey("Id");
b.ToTable("AbpClaimTypes");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
{
b.Property<Guid>("Id")
@ -54,6 +83,15 @@ namespace Acme.BookStore.Migrations
b.Property<string>("ConcurrencyStamp");
b.Property<bool>("IsDefault")
.HasColumnName("IsDefault");
b.Property<bool>("IsPublic")
.HasColumnName("IsPublic");
b.Property<bool>("IsStatic")
.HasColumnName("IsStatic");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256);
@ -109,6 +147,14 @@ namespace Acme.BookStore.Migrations
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(256);
b.Property<DateTime>("CreationTime");
b.Property<Guid?>("CreatorId");
b.Property<Guid?>("DeleterId");
b.Property<DateTime?>("DeletionTime");
b.Property<string>("Email")
.HasColumnName("Email")
.HasMaxLength(256);
@ -121,6 +167,12 @@ namespace Acme.BookStore.Migrations
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted");
b.Property<DateTime?>("LastModificationTime");
b.Property<Guid?>("LastModifierId");
b.Property<bool>("LockoutEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("LockoutEnabled")
@ -128,6 +180,10 @@ namespace Acme.BookStore.Migrations
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("Name")
.HasColumnName("Name")
.HasMaxLength(64);
b.Property<string>("NormalizedEmail")
.HasColumnName("NormalizedEmail")
.HasMaxLength(256);
@ -155,6 +211,10 @@ namespace Acme.BookStore.Migrations
.HasColumnName("SecurityStamp")
.HasMaxLength(256);
b.Property<string>("Surname")
.HasColumnName("Surname")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
@ -247,9 +307,10 @@ namespace Acme.BookStore.Migrations
b.Property<Guid>("UserId");
b.Property<string>("LoginProvider")
.HasMaxLength(128);
.HasMaxLength(64);
b.Property<string>("Name");
b.Property<string>("Name")
.HasMaxLength(128);
b.Property<Guid?>("TenantId");

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

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

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

@ -8,8 +8,8 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Acme.BookStore.Application\Acme.BookStore.Application.csproj" />
<ProjectReference Include="..\..\src\Acme.BookStore.EntityFrameworkCore\Acme.BookStore.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.TestBase" Version="0.4.1" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.4.1" />
<PackageReference Include="Volo.Abp.TestBase" Version="0.8.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.8.0" />
</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" />
<ProjectReference Include="..\Acme.BookStore.Application.Tests\Acme.BookStore.Application.Tests.csproj" />
<ProjectReference Include="..\..\src\Acme.BookStore.Web\Acme.BookStore.Web.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.TestBase" Version="0.4.1" />
<PackageReference Include="Volo.Abp.AspNetCore.TestBase" Version="0.8.0" />
</ItemGroup>
<ItemGroup>

Loading…
Cancel
Save