Skip to content

Commit

Permalink
Fix: CreateExtensions.vue's content & format
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenjiang110 committed Jul 27, 2024
1 parent 95b99d3 commit 51c5c47
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Bob.Abp.AppGen/Models/Enums/AbpMainFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public static class AbpMainFileExtension
new[] {
new AhProjectItem(AbpProjectType.Web, "Menus", "MenuItemInfo.cs", "Menu.MenuItemInfo", secured: true),
new AhEditProjectItem(AbpProjectType.Web, "Menus", "{0}Menus.cs", vsCMElement.vsCMElementVariable, "{1}", "Menu.Consts" )
.AddEditPoint(null, vsCMElement.vsCMElementClass, Positions.End, "TemplateType"),
.AddEditPoint(null, vsCMElement.vsCMElementClass, Positions.End, TemplateType.Main),
new AhEditProjectItem(AbpProjectType.Web, "Menus", "{0}MenuContributor.cs", vsCMElement.vsCMElementFunction, "Configure{0}MenuAsync", "Menu.ContributorModify", secured: true)
.AddEditPoint(null, vsCMElement.vsCMElementNamespace, Positions.Before, TemplateType.Using)
.AddEditPoint("ConfigureMenuAsync", vsCMElement.vsCMElementFunction, Positions.End | Positions.ExtraMove, TemplateType.Calling)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;

namespace {{Namespace}}
namespace {{RootNamespace}}.{{ModuleName}}.EntityFrameworkCore
{
public static class {{ModuleName}}DbContextModelCreatingExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

Configure{{EntityName}}(builder);
Configure{{EntityName}}(builder);
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@

private static void Configure{{EntityName}}(ModelBuilder builder)
{
builder.Entity<{{EntityName}}>(b =>
private static void Configure{{EntityName}}(ModelBuilder builder)
{
//Configure table & schema name
b.ToTable({{ModuleName}}DbProperties.DbTablePrefix + "{{ToPlural EntityName}}", {{ModuleName}}DbProperties.DbSchema);
b.ConfigureByConvention();
{{#AllProperties}}
{{#IsString}}
b.Property(q => q.{{PropertyName}}){{#Required}}.IsRequired(){{/Required}}.HasMaxLength({{EntityName}}Consts.Max{{PropertyName}}Length);
{{/IsString}}
{{/AllProperties}}
builder.Entity<{{EntityName}}>(b =>
{
//Configure table & schema name
b.ToTable({{ModuleName}}DbProperties.DbTablePrefix + "{{ToPlural EntityName}}", {{ModuleName}}DbProperties.DbSchema);
b.ConfigureByConvention();
{{#AllProperties}}
{{#IsString}}
b.Property(q => q.{{PropertyName}}){{#Required}}.IsRequired(){{/Required}}.HasMaxLength({{EntityName}}Consts.Max{{PropertyName}}Length);
{{/IsString}}
{{/AllProperties}}

//Relations
//b.HasMany<{{EntityName}}>().WithOne().HasForeignKey(p => p.ParentId).OnDelete(DeleteBehavior.ClientSetNull);
//Relations
//b.HasMany<{{EntityName}}>().WithOne().HasForeignKey(p => p.ParentId).OnDelete(DeleteBehavior.ClientSetNull);

//Indexes
//b.HasIndex(q => q.Code);
});
}
//Indexes
//b.HasIndex(q => q.Code);
});
}

0 comments on commit 51c5c47

Please sign in to comment.