Browse Source

add efcore configextensions

master
wwwk 3 years ago
parent
commit
c517d84cd5
  1. 21
      Sanhe.Abp.Framework.sln
  2. 3
      modules/common/Sanhe.Abp.EntityFrameworkCore/FodyWeavers.xml
  3. 14
      modules/common/Sanhe.Abp.EntityFrameworkCore/Sanhe.Abp.EntityFrameworkCore.csproj
  4. 26
      modules/common/Sanhe.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs
  5. 3
      modules/identity/Sanhe.Abp.Identity.HttpApi/Sanhe/Abp/Identity/IdentityClaimTypeController.cs
  6. 3
      modules/identity/Sanhe.Abp.Identity.HttpApi/Sanhe/Abp/Identity/IdentityRoleController.cs
  7. 3
      modules/identity/Sanhe.Abp.Identity.HttpApi/Sanhe/Abp/Identity/IdentityUserController.cs
  8. 3
      modules/identity/Sanhe.Abp.Identity.HttpApi/Sanhe/Abp/Identity/OrganizationUnitController.cs
  9. 1
      services/book-store/BookStore.csproj
  10. 50
      services/book-store/Controllers/BookController.cs
  11. 16
      services/book-store/Data/BookStoreDbContext.cs
  12. 0
      services/book-store/Entities/.gitkeep
  13. 15
      services/book-store/Entities/Book.cs
  14. 2432
      services/book-store/Migrations/20220509122124_Add_Books.Designer.cs
  15. 33
      services/book-store/Migrations/20220509122124_Add_Books.cs
  16. 23
      services/book-store/Migrations/BookStoreDbContextModelSnapshot.cs
  17. 4
      services/book-store/ObjectMapping/BookStoreAutoMapperProfile.cs
  18. 16
      services/book-store/Services/BookAppService.cs
  19. 0
      services/book-store/Services/Dtos/.gitkeep
  20. 16
      services/book-store/Services/Dtos/BookCreateUpdateInput.cs
  21. 14
      services/book-store/Services/Dtos/BookDto.cs
  22. 11
      services/book-store/Services/IBookAppService.cs

21
Sanhe.Abp.Framework.sln

@ -71,19 +71,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sanhe.Abp.Notifications", "
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "identity", "identity", "{BAA5EE9D-A5C6-45F3-A89B-B3CC30FF3DFE}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "identity", "identity", "{BAA5EE9D-A5C6-45F3-A89B-B3CC30FF3DFE}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sanhe.Abp.Identity.Domain.Shared", "modules\identity\Sanhe.Abp.Identity.Domain.Shared\Sanhe.Abp.Identity.Domain.Shared.csproj", "{86E8E59C-FDB8-45E5-B9DE-BEFE51DF05DC}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sanhe.Abp.Identity.Domain.Shared", "modules\identity\Sanhe.Abp.Identity.Domain.Shared\Sanhe.Abp.Identity.Domain.Shared.csproj", "{86E8E59C-FDB8-45E5-B9DE-BEFE51DF05DC}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sanhe.Abp.Identity.Domain", "modules\identity\Sanhe.Abp.Identity.Domain\Sanhe.Abp.Identity.Domain.csproj", "{6531A9CD-E1B2-4861-8C31-9561220D088B}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sanhe.Abp.Identity.Domain", "modules\identity\Sanhe.Abp.Identity.Domain\Sanhe.Abp.Identity.Domain.csproj", "{6531A9CD-E1B2-4861-8C31-9561220D088B}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sanhe.Abp.Identity.Application.Contracts", "modules\identity\Sanhe.Abp.Identity.Application.Contracts\Sanhe.Abp.Identity.Application.Contracts.csproj", "{CA166F9C-7535-4CB7-B8B5-D01971B8C09F}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sanhe.Abp.Identity.Application.Contracts", "modules\identity\Sanhe.Abp.Identity.Application.Contracts\Sanhe.Abp.Identity.Application.Contracts.csproj", "{CA166F9C-7535-4CB7-B8B5-D01971B8C09F}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sanhe.Abp.Identity.Application", "modules\identity\Sanhe.Abp.Identity.Application\Sanhe.Abp.Identity.Application.csproj", "{39102CCF-4AFB-44F2-9D9D-3D2449D71C88}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sanhe.Abp.Identity.Application", "modules\identity\Sanhe.Abp.Identity.Application\Sanhe.Abp.Identity.Application.csproj", "{39102CCF-4AFB-44F2-9D9D-3D2449D71C88}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sanhe.Abp.Identity.EntityFrameworkCore", "modules\identity\Sanhe.Abp.Identity.EntityFrameworkCore\Sanhe.Abp.Identity.EntityFrameworkCore.csproj", "{9C8F2135-A237-41D9-B054-C6170D2CC6B2}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sanhe.Abp.Identity.EntityFrameworkCore", "modules\identity\Sanhe.Abp.Identity.EntityFrameworkCore\Sanhe.Abp.Identity.EntityFrameworkCore.csproj", "{9C8F2135-A237-41D9-B054-C6170D2CC6B2}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sanhe.Abp.Identity.HttpApi", "modules\identity\Sanhe.Abp.Identity.HttpApi\Sanhe.Abp.Identity.HttpApi.csproj", "{F53FC671-99FD-4CD8-915E-5B77619A6C6B}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sanhe.Abp.Identity.HttpApi", "modules\identity\Sanhe.Abp.Identity.HttpApi\Sanhe.Abp.Identity.HttpApi.csproj", "{F53FC671-99FD-4CD8-915E-5B77619A6C6B}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sanhe.Abp.Identity.HttpApi.Client", "modules\identity\Sanhe.Abp.Identity.HttpApi.Client\Sanhe.Abp.Identity.HttpApi.Client.csproj", "{6E5D3C18-45B4-478B-B064-140C5CDDD327}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sanhe.Abp.Identity.HttpApi.Client", "modules\identity\Sanhe.Abp.Identity.HttpApi.Client\Sanhe.Abp.Identity.HttpApi.Client.csproj", "{6E5D3C18-45B4-478B-B064-140C5CDDD327}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sanhe.Abp.EntityFrameworkCore", "modules\common\Sanhe.Abp.EntityFrameworkCore\Sanhe.Abp.EntityFrameworkCore.csproj", "{464E3A2C-BBEB-4CD9-BAB8-A51D6283940A}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -207,6 +209,10 @@ Global
{6E5D3C18-45B4-478B-B064-140C5CDDD327}.Debug|Any CPU.Build.0 = Debug|Any CPU {6E5D3C18-45B4-478B-B064-140C5CDDD327}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E5D3C18-45B4-478B-B064-140C5CDDD327}.Release|Any CPU.ActiveCfg = Release|Any CPU {6E5D3C18-45B4-478B-B064-140C5CDDD327}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E5D3C18-45B4-478B-B064-140C5CDDD327}.Release|Any CPU.Build.0 = Release|Any CPU {6E5D3C18-45B4-478B-B064-140C5CDDD327}.Release|Any CPU.Build.0 = Release|Any CPU
{464E3A2C-BBEB-4CD9-BAB8-A51D6283940A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{464E3A2C-BBEB-4CD9-BAB8-A51D6283940A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{464E3A2C-BBEB-4CD9-BAB8-A51D6283940A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{464E3A2C-BBEB-4CD9-BAB8-A51D6283940A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -247,6 +253,7 @@ Global
{9C8F2135-A237-41D9-B054-C6170D2CC6B2} = {BAA5EE9D-A5C6-45F3-A89B-B3CC30FF3DFE} {9C8F2135-A237-41D9-B054-C6170D2CC6B2} = {BAA5EE9D-A5C6-45F3-A89B-B3CC30FF3DFE}
{F53FC671-99FD-4CD8-915E-5B77619A6C6B} = {BAA5EE9D-A5C6-45F3-A89B-B3CC30FF3DFE} {F53FC671-99FD-4CD8-915E-5B77619A6C6B} = {BAA5EE9D-A5C6-45F3-A89B-B3CC30FF3DFE}
{6E5D3C18-45B4-478B-B064-140C5CDDD327} = {BAA5EE9D-A5C6-45F3-A89B-B3CC30FF3DFE} {6E5D3C18-45B4-478B-B064-140C5CDDD327} = {BAA5EE9D-A5C6-45F3-A89B-B3CC30FF3DFE}
{464E3A2C-BBEB-4CD9-BAB8-A51D6283940A} = {2A768109-31B7-4C52-928C-3023DAB9F254}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AB69BFDE-9DDB-4D16-8CB8-72472C0319CD} SolutionGuid = {AB69BFDE-9DDB-4D16-8CB8-72472C0319CD}

3
modules/common/Sanhe.Abp.EntityFrameworkCore/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

14
modules/common/Sanhe.Abp.EntityFrameworkCore/Sanhe.Abp.EntityFrameworkCore.csproj

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="$(VoloAbpVersion)" />
</ItemGroup>
</Project>

26
modules/common/Sanhe.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs

@ -0,0 +1,26 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.ComponentModel;
using System.Reflection;
namespace Volo.Abp.EntityFrameworkCore.Modeling;
public static class AbpEntityTypeBuilderExtensions
{
public static void ConfigureCommentByDisplayName<T>(this EntityTypeBuilder<T> builder) where T : class
{
Check.NotNull(builder, nameof(builder));
Type type = typeof(T);
PropertyInfo[] properties = type.GetProperties();
foreach (PropertyInfo propertyInfo in properties)
{
string text = propertyInfo.GetCustomAttribute<DisplayNameAttribute>()?.DisplayName;
if (!string.IsNullOrEmpty(text))
{
builder.Property(propertyInfo.Name).HasComment(text);
}
}
builder.HasComment(type.GetCustomAttribute<DisplayNameAttribute>()?.DisplayName);
}
}

3
modules/identity/Sanhe.Abp.Identity.HttpApi/Sanhe/Abp/Identity/IdentityClaimTypeController.cs

@ -9,9 +9,6 @@ using Volo.Abp.Identity;
namespace Sanhe.Abp.Identity namespace Sanhe.Abp.Identity
{ {
/// <summary>
/// 身份声明类型
/// </summary>
[RemoteService(true, Name = IdentityRemoteServiceConsts.RemoteServiceName)] [RemoteService(true, Name = IdentityRemoteServiceConsts.RemoteServiceName)]
[Area("identity")] [Area("identity")]
[ControllerName("ClaimType")] [ControllerName("ClaimType")]

3
modules/identity/Sanhe.Abp.Identity.HttpApi/Sanhe/Abp/Identity/IdentityRoleController.cs

@ -9,9 +9,6 @@ using Volo.Abp.Identity;
namespace Sanhe.Abp.Identity namespace Sanhe.Abp.Identity
{ {
/// <summary>
/// 角色
/// </summary>
[RemoteService(true, Name = IdentityRemoteServiceConsts.RemoteServiceName)] [RemoteService(true, Name = IdentityRemoteServiceConsts.RemoteServiceName)]
[Area("identity")] [Area("identity")]
[ControllerName("Role")] [ControllerName("Role")]

3
modules/identity/Sanhe.Abp.Identity.HttpApi/Sanhe/Abp/Identity/IdentityUserController.cs

@ -9,9 +9,6 @@ using Volo.Abp.Identity;
namespace Sanhe.Abp.Identity namespace Sanhe.Abp.Identity
{ {
/// <summary>
/// 用户
/// </summary>
[RemoteService(true, Name = IdentityRemoteServiceConsts.RemoteServiceName)] [RemoteService(true, Name = IdentityRemoteServiceConsts.RemoteServiceName)]
[Area("identity")] [Area("identity")]
[ControllerName("User")] [ControllerName("User")]

3
modules/identity/Sanhe.Abp.Identity.HttpApi/Sanhe/Abp/Identity/OrganizationUnitController.cs

@ -9,9 +9,6 @@ using Volo.Abp.Identity;
namespace Sanhe.Abp.Identity namespace Sanhe.Abp.Identity
{ {
/// <summary>
/// 组织单位
/// </summary>
[RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)] [RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)]
[Area("identity")] [Area("identity")]
[ControllerName("organization-units")] [ControllerName("organization-units")]

1
services/book-store/BookStore.csproj

@ -479,6 +479,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\modules\common\Sanhe.Abp.EntityFrameworkCore\Sanhe.Abp.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\common\Sanhe.Abp.ExceptionHandling.Emailing\Sanhe.Abp.ExceptionHandling.Emailing.csproj" /> <ProjectReference Include="..\..\modules\common\Sanhe.Abp.ExceptionHandling.Emailing\Sanhe.Abp.ExceptionHandling.Emailing.csproj" />
<ProjectReference Include="..\..\modules\common\Sanhe.Abp.Features.LimitValidation.Redis\Sanhe.Abp.Features.LimitValidation.Redis.csproj" /> <ProjectReference Include="..\..\modules\common\Sanhe.Abp.Features.LimitValidation.Redis\Sanhe.Abp.Features.LimitValidation.Redis.csproj" />
<ProjectReference Include="..\..\modules\common\Sanhe.Abp.Hangfire.Dashboard\Sanhe.Abp.Hangfire.Dashboard.csproj" /> <ProjectReference Include="..\..\modules\common\Sanhe.Abp.Hangfire.Dashboard\Sanhe.Abp.Hangfire.Dashboard.csproj" />

50
services/book-store/Controllers/BookController.cs

@ -0,0 +1,50 @@
using BookStore.Services;
using BookStore.Services.Dtos;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
namespace BookStore.Controllers;
[Route("api/books")]
public class BookController: AbpController, IBookAppService
{
private readonly IBookAppService _bookAppService;
public BookController(IBookAppService bookAppService)
{
_bookAppService = bookAppService;
}
[HttpPost]
public Task<BookDto> CreateAsync(BookCreateUpdateInput input)
{
return _bookAppService.CreateAsync(input);
}
[HttpDelete("{id}")]
public Task DeleteAsync(Guid id)
{
return _bookAppService.DeleteAsync(id);
}
[HttpGet("{id}")]
public Task<BookDto> GetAsync(Guid id)
{
return _bookAppService.GetAsync(id);
}
[HttpGet]
public Task<PagedResultDto<BookDto>> GetListAsync(PagedAndSortedResultRequestDto input)
{
return _bookAppService.GetListAsync(input);
}
[HttpPut("{id}")]
public Task<BookDto> UpdateAsync(Guid id, BookCreateUpdateInput input)
{
return _bookAppService.UpdateAsync(id, input);
}
}

16
services/book-store/Data/BookStoreDbContext.cs

@ -1,7 +1,9 @@
using Microsoft.EntityFrameworkCore; using BookStore.Entities;
using Microsoft.EntityFrameworkCore;
using Sanhe.Abp.LocalizationManagement.EntityFrameworkCore; using Sanhe.Abp.LocalizationManagement.EntityFrameworkCore;
using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Abp.FeatureManagement.EntityFrameworkCore; using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.IdentityServer.EntityFrameworkCore;
@ -13,6 +15,8 @@ namespace BookStore.Data;
public class BookStoreDbContext : AbpDbContext<BookStoreDbContext> public class BookStoreDbContext : AbpDbContext<BookStoreDbContext>
{ {
public DbSet<Book> Books { get; set; }
public BookStoreDbContext(DbContextOptions<BookStoreDbContext> options) public BookStoreDbContext(DbContextOptions<BookStoreDbContext> options)
: base(options) : base(options)
{ {
@ -34,5 +38,15 @@ public class BookStoreDbContext : AbpDbContext<BookStoreDbContext>
builder.ConfigureLocalization(); builder.ConfigureLocalization();
/* Configure your own entities here */ /* Configure your own entities here */
builder.Entity<Book>(b =>
{
b.ToTable("Books");
b.Property(p => p.BookName).HasMaxLength(64).IsRequired();
b.Property(p => p.Description).HasMaxLength(512);
b.ConfigureCommentByDisplayName();
b.ConfigureByConvention();
});
} }
} }

0
services/book-store/Entities/.gitkeep

15
services/book-store/Entities/Book.cs

@ -0,0 +1,15 @@
using System;
using System.ComponentModel;
using Volo.Abp.Domain.Entities;
namespace BookStore.Entities;
[DisplayName("书籍")]
public class Book: Entity<Guid>
{
[DisplayName("书籍名称")]
public string BookName { get; set; }
[DisplayName("描述")]
public string Description { get; set; }
}

2432
services/book-store/Migrations/20220509122124_Add_Books.Designer.cs generated

File diff suppressed because it is too large Load Diff

33
services/book-store/Migrations/20220509122124_Add_Books.cs

@ -0,0 +1,33 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BookStore.Migrations
{
public partial class Add_Books : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Books",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
BookName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false, comment: "书籍名称"),
Description = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true, comment: "描述")
},
constraints: table =>
{
table.PrimaryKey("PK_Books", x => x.Id);
},
comment: "书籍");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Books");
}
}
}

23
services/book-store/Migrations/BookStoreDbContextModelSnapshot.cs

@ -24,6 +24,29 @@ namespace BookStore.Migrations
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("BookStore.Entities.Book", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<string>("BookName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("书籍名称");
b.Property<string>("Description")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("描述");
b.HasKey("Id");
b.ToTable("Books", (string)null);
b.HasComment("书籍");
});
modelBuilder.Entity("Sanhe.Abp.LocalizationManagement.Language", b => modelBuilder.Entity("Sanhe.Abp.LocalizationManagement.Language", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")

4
services/book-store/ObjectMapping/BookStoreAutoMapperProfile.cs

@ -1,4 +1,6 @@
using AutoMapper; using AutoMapper;
using BookStore.Entities;
using BookStore.Services.Dtos;
namespace BookStore.ObjectMapping; namespace BookStore.ObjectMapping;
@ -7,5 +9,7 @@ public class BookStoreAutoMapperProfile : Profile
public BookStoreAutoMapperProfile() public BookStoreAutoMapperProfile()
{ {
/* Create your AutoMapper object mappings here */ /* Create your AutoMapper object mappings here */
CreateMap<BookCreateUpdateInput, Book>();
CreateMap<Book, BookDto>();
} }
} }

16
services/book-store/Services/BookAppService.cs

@ -0,0 +1,16 @@
using BookStore.Entities;
using BookStore.Services.Dtos;
using System;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
namespace BookStore.Services;
public class BookAppService : CrudAppService<Book, BookDto, Guid, PagedAndSortedResultRequestDto, BookCreateUpdateInput>, IBookAppService
{
public BookAppService(IRepository<Book, Guid> repository) : base(repository)
{
}
}

0
services/book-store/Services/Dtos/.gitkeep

16
services/book-store/Services/Dtos/BookCreateUpdateInput.cs

@ -0,0 +1,16 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace BookStore.Services.Dtos;
public class BookCreateUpdateInput
{
[Required]
[StringLength(64)]
[DisplayName("书籍名称")]
public string BookName { get; set; }
[StringLength(512)]
[DisplayName("描述")]
public string Description { get; set; }
}

14
services/book-store/Services/Dtos/BookDto.cs

@ -0,0 +1,14 @@
using System;
using System.ComponentModel;
using Volo.Abp.Application.Dtos;
namespace BookStore.Services.Dtos;
public class BookDto: EntityDto<Guid>
{
[DisplayName("书籍名称")]
public string BookName { get; set; }
[DisplayName("描述")]
public string Description { get; set; }
}

11
services/book-store/Services/IBookAppService.cs

@ -0,0 +1,11 @@
using BookStore.Services.Dtos;
using System;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace BookStore.Services;
public interface IBookAppService : ICrudAppService<BookDto, Guid, PagedAndSortedResultRequestDto, BookCreateUpdateInput>
{
}
Loading…
Cancel
Save