mirror of https://github.com/abpframework/abp.git
514 changed files with 8633 additions and 3018 deletions
@ -0,0 +1,826 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Metadata; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.AbpWebSite.EntityFrameworkCore; |
|||
|
|||
namespace Volo.AbpWebSite.EntityFrameworkCore.Migrations |
|||
{ |
|||
[DbContext(typeof(AbpWebSiteDbContext))] |
|||
[Migration("20181227114311_Added_ConcurrencyStamp_IsDeleted_ExtraProperties")] |
|||
partial class Added_ConcurrencyStamp_IsDeleted_ExtraProperties |
|||
{ |
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("ProductVersion", "2.1.4-rtm-31024") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 128) |
|||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.HasColumnName("ConcurrencyStamp") |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
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") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.IsRequired() |
|||
.HasColumnName("ConcurrencyStamp") |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
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); |
|||
|
|||
b.Property<string>("NormalizedName") |
|||
.IsRequired() |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<Guid?>("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("NormalizedName"); |
|||
|
|||
b.ToTable("AbpRoles"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<string>("ClaimType") |
|||
.IsRequired() |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<string>("ClaimValue") |
|||
.HasMaxLength(1024); |
|||
|
|||
b.Property<Guid>("RoleId"); |
|||
|
|||
b.Property<Guid?>("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("RoleId"); |
|||
|
|||
b.ToTable("AbpRoleClaims"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<int>("AccessFailedCount") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnName("AccessFailedCount") |
|||
.HasDefaultValue(0); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<Guid?>("DeleterId") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("Email") |
|||
.HasColumnName("Email") |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<bool>("EmailConfirmed") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnName("EmailConfirmed") |
|||
.HasDefaultValue(false); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnName("IsDeleted") |
|||
.HasDefaultValue(false); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<bool>("LockoutEnabled") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnName("LockoutEnabled") |
|||
.HasDefaultValue(false); |
|||
|
|||
b.Property<DateTimeOffset?>("LockoutEnd"); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasColumnName("Name") |
|||
.HasMaxLength(64); |
|||
|
|||
b.Property<string>("NormalizedEmail") |
|||
.HasColumnName("NormalizedEmail") |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<string>("NormalizedUserName") |
|||
.IsRequired() |
|||
.HasColumnName("NormalizedUserName") |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<string>("PasswordHash") |
|||
.HasColumnName("PasswordHash") |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<string>("PhoneNumber") |
|||
.HasColumnName("PhoneNumber") |
|||
.HasMaxLength(16); |
|||
|
|||
b.Property<bool>("PhoneNumberConfirmed") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnName("PhoneNumberConfirmed") |
|||
.HasDefaultValue(false); |
|||
|
|||
b.Property<string>("SecurityStamp") |
|||
.IsRequired() |
|||
.HasColumnName("SecurityStamp") |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<string>("Surname") |
|||
.HasColumnName("Surname") |
|||
.HasMaxLength(64); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<bool>("TwoFactorEnabled") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnName("TwoFactorEnabled") |
|||
.HasDefaultValue(false); |
|||
|
|||
b.Property<string>("UserName") |
|||
.IsRequired() |
|||
.HasColumnName("UserName") |
|||
.HasMaxLength(256); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Email"); |
|||
|
|||
b.HasIndex("NormalizedEmail"); |
|||
|
|||
b.HasIndex("NormalizedUserName"); |
|||
|
|||
b.HasIndex("UserName"); |
|||
|
|||
b.ToTable("AbpUsers"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<string>("ClaimType") |
|||
.IsRequired() |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<string>("ClaimValue") |
|||
.HasMaxLength(1024); |
|||
|
|||
b.Property<Guid?>("TenantId"); |
|||
|
|||
b.Property<Guid>("UserId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("UserId"); |
|||
|
|||
b.ToTable("AbpUserClaims"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => |
|||
{ |
|||
b.Property<Guid>("UserId"); |
|||
|
|||
b.Property<string>("LoginProvider") |
|||
.HasMaxLength(64); |
|||
|
|||
b.Property<string>("ProviderDisplayName") |
|||
.HasMaxLength(128); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.IsRequired() |
|||
.HasMaxLength(196); |
|||
|
|||
b.Property<Guid?>("TenantId"); |
|||
|
|||
b.HasKey("UserId", "LoginProvider"); |
|||
|
|||
b.HasIndex("LoginProvider", "ProviderKey"); |
|||
|
|||
b.ToTable("AbpUserLogins"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => |
|||
{ |
|||
b.Property<Guid>("UserId"); |
|||
|
|||
b.Property<Guid>("RoleId"); |
|||
|
|||
b.Property<Guid?>("TenantId"); |
|||
|
|||
b.HasKey("UserId", "RoleId"); |
|||
|
|||
b.HasIndex("RoleId", "UserId"); |
|||
|
|||
b.ToTable("AbpUserRoles"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => |
|||
{ |
|||
b.Property<Guid>("UserId"); |
|||
|
|||
b.Property<string>("LoginProvider") |
|||
.HasMaxLength(64); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasMaxLength(128); |
|||
|
|||
b.Property<Guid?>("TenantId"); |
|||
|
|||
b.Property<string>("Value"); |
|||
|
|||
b.HasKey("UserId", "LoginProvider", "Name"); |
|||
|
|||
b.ToTable("AbpUserTokens"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.IsRequired() |
|||
.HasMaxLength(64); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.IsRequired() |
|||
.HasMaxLength(64); |
|||
|
|||
b.Property<Guid?>("TenantId"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey"); |
|||
|
|||
b.ToTable("AbpPermissionGrants"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128); |
|||
|
|||
b.Property<string>("ProviderKey") |
|||
.HasMaxLength(64); |
|||
|
|||
b.Property<string>("ProviderName") |
|||
.HasMaxLength(64); |
|||
|
|||
b.Property<string>("Value") |
|||
.IsRequired() |
|||
.HasMaxLength(2048); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "ProviderName", "ProviderKey"); |
|||
|
|||
b.ToTable("AbpSettings"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<string>("ConcurrencyStamp"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<Guid?>("DeleterId") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasColumnName("Description") |
|||
.HasMaxLength(1024); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnName("IsDeleted") |
|||
.HasDefaultValue(false); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasColumnName("Name") |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<string>("ShortName") |
|||
.IsRequired() |
|||
.HasColumnName("ShortName") |
|||
.HasMaxLength(32); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("BlgBlogs"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<string>("ConcurrencyStamp"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<Guid?>("DeleterId") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnName("IsDeleted") |
|||
.HasDefaultValue(false); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<Guid>("PostId") |
|||
.HasColumnName("PostId"); |
|||
|
|||
b.Property<Guid?>("RepliedCommentId") |
|||
.HasColumnName("RepliedCommentId"); |
|||
|
|||
b.Property<string>("Text") |
|||
.IsRequired() |
|||
.HasColumnName("Text") |
|||
.HasMaxLength(1024); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("PostId"); |
|||
|
|||
b.HasIndex("RepliedCommentId"); |
|||
|
|||
b.ToTable("BlgComments"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Blogging.Posts.Post", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<Guid>("BlogId") |
|||
.HasColumnName("BlogId"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("Content") |
|||
.HasColumnName("Content") |
|||
.HasMaxLength(1048576); |
|||
|
|||
b.Property<string>("CoverImage") |
|||
.IsRequired() |
|||
.HasColumnName("CoverImage"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<Guid?>("DeleterId") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnName("IsDeleted") |
|||
.HasDefaultValue(false); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<int>("ReadCount"); |
|||
|
|||
b.Property<string>("Title") |
|||
.IsRequired() |
|||
.HasColumnName("Title") |
|||
.HasMaxLength(512); |
|||
|
|||
b.Property<string>("Url") |
|||
.IsRequired() |
|||
.HasColumnName("Url") |
|||
.HasMaxLength(64); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("BlogId"); |
|||
|
|||
b.ToTable("BlgPosts"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b => |
|||
{ |
|||
b.Property<Guid>("PostId") |
|||
.HasColumnName("PostId"); |
|||
|
|||
b.Property<Guid>("TagId") |
|||
.HasColumnName("TagId"); |
|||
|
|||
b.Property<DateTime>("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId"); |
|||
|
|||
b.HasKey("PostId", "TagId"); |
|||
|
|||
b.HasIndex("TagId"); |
|||
|
|||
b.ToTable("BlgPostTags"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Blogging.Tagging.Tag", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<Guid>("BlogId"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<Guid?>("DeleterId") |
|||
.HasColumnName("DeleterId"); |
|||
|
|||
b.Property<DateTime?>("DeletionTime") |
|||
.HasColumnName("DeletionTime"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasColumnName("Description") |
|||
.HasMaxLength(512); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<bool>("IsDeleted") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnName("IsDeleted") |
|||
.HasDefaultValue(false); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasColumnName("Name") |
|||
.HasMaxLength(64); |
|||
|
|||
b.Property<int>("UsageCount") |
|||
.HasColumnName("UsageCount"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("BlgTags"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Blogging.Users.BlogUser", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<string>("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("Email") |
|||
.HasColumnName("Email") |
|||
.HasMaxLength(256); |
|||
|
|||
b.Property<bool>("EmailConfirmed") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnName("EmailConfirmed") |
|||
.HasDefaultValue(false); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Name") |
|||
.HasColumnName("Name") |
|||
.HasMaxLength(64); |
|||
|
|||
b.Property<string>("PhoneNumber") |
|||
.HasColumnName("PhoneNumber") |
|||
.HasMaxLength(16); |
|||
|
|||
b.Property<bool>("PhoneNumberConfirmed") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnName("PhoneNumberConfirmed") |
|||
.HasDefaultValue(false); |
|||
|
|||
b.Property<string>("Surname") |
|||
.HasColumnName("Surname") |
|||
.HasMaxLength(64); |
|||
|
|||
b.Property<Guid?>("TenantId") |
|||
.HasColumnName("TenantId"); |
|||
|
|||
b.Property<string>("UserName") |
|||
.IsRequired() |
|||
.HasColumnName("UserName") |
|||
.HasMaxLength(256); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("BlgUsers"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Docs.Projects.Project", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<string>("DefaultDocumentName") |
|||
.IsRequired() |
|||
.HasMaxLength(128); |
|||
|
|||
b.Property<string>("DocumentStoreType"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Format"); |
|||
|
|||
b.Property<string>("LatestVersionBranchName") |
|||
.HasMaxLength(128); |
|||
|
|||
b.Property<string>("MainWebsiteUrl"); |
|||
|
|||
b.Property<string>("MinimumVersion"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(128); |
|||
|
|||
b.Property<string>("NavigationDocumentName") |
|||
.IsRequired() |
|||
.HasMaxLength(128); |
|||
|
|||
b.Property<string>("ShortName") |
|||
.IsRequired() |
|||
.HasMaxLength(32); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("DocsProjects"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Utils.SolutionTemplating.DownloadInfo", b => |
|||
{ |
|||
b.Property<int>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<int>("CreationDuration"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<byte>("DatabaseProvider"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("ProjectName") |
|||
.IsRequired() |
|||
.HasMaxLength(128); |
|||
|
|||
b.Property<string>("TemplateName") |
|||
.IsRequired() |
|||
.HasMaxLength(42); |
|||
|
|||
b.Property<string>("Version") |
|||
.IsRequired() |
|||
.HasMaxLength(20); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("Downloads"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => |
|||
{ |
|||
b.HasOne("Volo.Abp.Identity.IdentityRole") |
|||
.WithMany("Claims") |
|||
.HasForeignKey("RoleId") |
|||
.OnDelete(DeleteBehavior.Cascade); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => |
|||
{ |
|||
b.HasOne("Volo.Abp.Identity.IdentityUser") |
|||
.WithMany("Claims") |
|||
.HasForeignKey("UserId") |
|||
.OnDelete(DeleteBehavior.Cascade); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => |
|||
{ |
|||
b.HasOne("Volo.Abp.Identity.IdentityUser") |
|||
.WithMany("Logins") |
|||
.HasForeignKey("UserId") |
|||
.OnDelete(DeleteBehavior.Cascade); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => |
|||
{ |
|||
b.HasOne("Volo.Abp.Identity.IdentityRole") |
|||
.WithMany() |
|||
.HasForeignKey("RoleId") |
|||
.OnDelete(DeleteBehavior.Cascade); |
|||
|
|||
b.HasOne("Volo.Abp.Identity.IdentityUser") |
|||
.WithMany("Roles") |
|||
.HasForeignKey("UserId") |
|||
.OnDelete(DeleteBehavior.Cascade); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => |
|||
{ |
|||
b.HasOne("Volo.Abp.Identity.IdentityUser") |
|||
.WithMany("Tokens") |
|||
.HasForeignKey("UserId") |
|||
.OnDelete(DeleteBehavior.Cascade); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b => |
|||
{ |
|||
b.HasOne("Volo.Blogging.Posts.Post") |
|||
.WithMany() |
|||
.HasForeignKey("PostId") |
|||
.OnDelete(DeleteBehavior.Cascade); |
|||
|
|||
b.HasOne("Volo.Blogging.Comments.Comment") |
|||
.WithMany() |
|||
.HasForeignKey("RepliedCommentId"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Blogging.Posts.Post", b => |
|||
{ |
|||
b.HasOne("Volo.Blogging.Blogs.Blog") |
|||
.WithMany() |
|||
.HasForeignKey("BlogId") |
|||
.OnDelete(DeleteBehavior.Cascade); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b => |
|||
{ |
|||
b.HasOne("Volo.Blogging.Posts.Post") |
|||
.WithMany("Tags") |
|||
.HasForeignKey("PostId") |
|||
.OnDelete(DeleteBehavior.Cascade); |
|||
|
|||
b.HasOne("Volo.Blogging.Tagging.Tag") |
|||
.WithMany() |
|||
.HasForeignKey("TagId") |
|||
.OnDelete(DeleteBehavior.Cascade); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace Volo.AbpWebSite.EntityFrameworkCore.Migrations |
|||
{ |
|||
public partial class Added_ConcurrencyStamp_IsDeleted_ExtraProperties : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<bool>( |
|||
name: "IsDeleted", |
|||
table: "AbpUsers", |
|||
nullable: false, |
|||
defaultValue: false, |
|||
oldClrType: typeof(bool)); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpUsers", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldMaxLength: 256); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpRoles", |
|||
maxLength: 256, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpClaimTypes", |
|||
maxLength: 256, |
|||
nullable: false, |
|||
defaultValue: ""); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "ExtraProperties", |
|||
table: "AbpClaimTypes", |
|||
nullable: true); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpClaimTypes"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "ExtraProperties", |
|||
table: "AbpClaimTypes"); |
|||
|
|||
migrationBuilder.AlterColumn<bool>( |
|||
name: "IsDeleted", |
|||
table: "AbpUsers", |
|||
nullable: false, |
|||
oldClrType: typeof(bool), |
|||
oldDefaultValue: false); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpUsers", |
|||
maxLength: 256, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpRoles", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldMaxLength: 256); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssemblyName>Volo.Abp.AspNetCore.Mvc.Client</AssemblyName> |
|||
<PackageId>Volo.Abp.AspNetCore.Mvc.Client</PackageId> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.Contracts\Volo.Abp.AspNetCore.Mvc.Contracts.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.Caching\Volo.Abp.Caching.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.Http.Client\Volo.Abp.Http.Client.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,26 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.Client |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpHttpClientModule), |
|||
typeof(AbpAspNetCoreMvcContractsModule), |
|||
typeof(AbpCachingModule) |
|||
)] |
|||
public class AbpAspNetCoreMvcClientModule : AbpModule |
|||
{ |
|||
public const string RemoteServiceName = "AbpMvcClient"; |
|||
|
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddHttpClientProxies( |
|||
typeof(AbpAspNetCoreMvcContractsModule).Assembly, |
|||
RemoteServiceName, |
|||
asDefaultServices: false |
|||
); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
using System; |
|||
using Microsoft.AspNetCore.Http; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client.DynamicProxying; |
|||
using Volo.Abp.Users; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.Client |
|||
{ |
|||
public class CachedApplicationConfigurationClient : ICachedApplicationConfigurationClient, ITransientDependency |
|||
{ |
|||
public IHttpContextAccessor HttpContextAccessor { get; set; } |
|||
|
|||
protected IHttpClientProxy<IAbpApplicationConfigurationAppService> Proxy { get; } |
|||
protected ICurrentUser CurrentUser { get; } |
|||
protected IDistributedCache<ApplicationConfigurationDto> Cache { get; } |
|||
|
|||
public CachedApplicationConfigurationClient( |
|||
IDistributedCache<ApplicationConfigurationDto> cache, |
|||
IHttpClientProxy<IAbpApplicationConfigurationAppService> proxy, |
|||
ICurrentUser currentUser, |
|||
IHttpContextAccessor httpContextAccessor) |
|||
{ |
|||
Proxy = proxy; |
|||
CurrentUser = currentUser; |
|||
HttpContextAccessor = httpContextAccessor; |
|||
Cache = cache; |
|||
} |
|||
|
|||
public async Task<ApplicationConfigurationDto> GetAsync() |
|||
{ |
|||
var cacheKey = CreateCacheKey(); |
|||
var httpContext = HttpContextAccessor?.HttpContext; |
|||
|
|||
if (httpContext != null && httpContext.Items[cacheKey] is ApplicationConfigurationDto configuration) |
|||
{ |
|||
return configuration; |
|||
} |
|||
|
|||
configuration = await Cache.GetOrAddAsync( |
|||
CreateCacheKey(), |
|||
async () => await Proxy.Service.GetAsync(), |
|||
() => new DistributedCacheEntryOptions |
|||
{ |
|||
AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(5) |
|||
} |
|||
); |
|||
|
|||
if (httpContext != null) |
|||
{ |
|||
httpContext.Items[cacheKey] = configuration; |
|||
} |
|||
|
|||
return configuration; |
|||
} |
|||
|
|||
protected virtual string CreateCacheKey() |
|||
{ |
|||
return $"ApplicationConfiguration_{CurrentUser.Id?.ToString("N") ?? "Anonymous"}"; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.Client |
|||
{ |
|||
public interface ICachedApplicationConfigurationClient |
|||
{ |
|||
Task<ApplicationConfigurationDto> GetAsync(); |
|||
} |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
using System.Security.Claims; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.Client |
|||
{ |
|||
public class RemotePermissionChecker : IPermissionChecker, ITransientDependency |
|||
{ |
|||
protected ICachedApplicationConfigurationClient ConfigurationClient { get; } |
|||
|
|||
public RemotePermissionChecker(ICachedApplicationConfigurationClient configurationClient) |
|||
{ |
|||
ConfigurationClient = configurationClient; |
|||
} |
|||
|
|||
public async Task<PermissionGrantInfo> CheckAsync(string name) |
|||
{ |
|||
var configuration = await ConfigurationClient.GetAsync(); |
|||
|
|||
return new PermissionGrantInfo( |
|||
name, |
|||
configuration.Auth.GrantedPolicies.ContainsKey(name) |
|||
); |
|||
} |
|||
|
|||
public Task<PermissionGrantInfo> CheckAsync(ClaimsPrincipal claimsPrincipal, string name) |
|||
{ |
|||
return CheckAsync(name); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssemblyName>Volo.Abp.AspNetCore.Mvc.Contracts</AssemblyName> |
|||
<PackageId>Volo.Abp.AspNetCore.Mvc.Contracts</PackageId> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.Ddd.Application\Volo.Abp.Ddd.Application.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,13 @@ |
|||
using Volo.Abp.Application; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpDddApplicationModule) |
|||
)] |
|||
public class AbpAspNetCoreMvcContractsModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -1,7 +1,9 @@ |
|||
using System.Collections.Generic; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations |
|||
{ |
|||
[Serializable] |
|||
public class ApplicationAuthConfigurationDto |
|||
{ |
|||
public Dictionary<string, bool> Policies { get; set; } |
|||
@ -1,9 +1,14 @@ |
|||
namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations |
|||
using System; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations |
|||
{ |
|||
[Serializable] |
|||
public class ApplicationConfigurationDto |
|||
{ |
|||
public ApplicationLocalizationConfigurationDto Localization { get; set; } |
|||
|
|||
public ApplicationAuthConfigurationDto Auth { get; set; } |
|||
|
|||
public CurrentUserDto CurrentUser { get; set; } |
|||
} |
|||
} |
|||
@ -1,7 +1,9 @@ |
|||
using System.Collections.Generic; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations |
|||
{ |
|||
[Serializable] |
|||
public class ApplicationLocalizationConfigurationDto |
|||
{ |
|||
public Dictionary<string, Dictionary<string, string>> Values { get; set; } |
|||
@ -0,0 +1,16 @@ |
|||
using System; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations |
|||
{ |
|||
[Serializable] |
|||
public class CurrentUserDto |
|||
{ |
|||
public bool IsAuthenticated { get; set; } |
|||
|
|||
public Guid? Id { get; set; } |
|||
|
|||
public Guid? TenantId { get; set; } |
|||
|
|||
public string UserName { get; set; } |
|||
} |
|||
} |
|||
@ -1,8 +1,9 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations |
|||
{ |
|||
public interface IApplicationConfigurationBuilder |
|||
public interface IAbpApplicationConfigurationAppService : IApplicationService |
|||
{ |
|||
Task<ApplicationConfigurationDto> GetAsync(); |
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Microsoft.AspNetCore.Mvc.ViewFeatures; |
|||
using Microsoft.Extensions.Localization; |
|||
using Microsoft.Extensions.Options; |
|||
using Volo.Abp.AspNetCore.Mvc.Localization; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers |
|||
{ |
|||
public class AbpTagHelperLocalizer : IAbpTagHelperLocalizer |
|||
{ |
|||
private readonly IStringLocalizerFactory _stringLocalizerFactory; |
|||
private readonly AbpMvcDataAnnotationsLocalizationOptions _options; |
|||
|
|||
public AbpTagHelperLocalizer(IOptions<AbpMvcDataAnnotationsLocalizationOptions> options, IStringLocalizerFactory stringLocalizerFactory) |
|||
{ |
|||
_stringLocalizerFactory = stringLocalizerFactory; |
|||
_options = options.Value; |
|||
} |
|||
|
|||
public string GetLocalizedText(string text, ModelExplorer explorer) |
|||
{ |
|||
var localizer = GetStringLocalizer(explorer); |
|||
|
|||
return localizer == null ? text : localizer[text].Value; |
|||
} |
|||
|
|||
public IStringLocalizer GetLocalizer(ModelExplorer explorer) |
|||
{ |
|||
return GetStringLocalizer(explorer); |
|||
} |
|||
|
|||
private IStringLocalizer GetStringLocalizer(ModelExplorer explorer) |
|||
{ |
|||
IStringLocalizer localizer = null; |
|||
var resourceType = _options.AssemblyResources.GetOrDefault(explorer.Container.ModelType.Assembly); |
|||
|
|||
if (resourceType != null) |
|||
{ |
|||
localizer = _stringLocalizerFactory.Create(resourceType); |
|||
} |
|||
|
|||
return localizer; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using Microsoft.AspNetCore.Mvc.ViewFeatures; |
|||
using Microsoft.Extensions.Localization; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers |
|||
{ |
|||
public interface IAbpTagHelperLocalizer : ITransientDependency |
|||
{ |
|||
string GetLocalizedText(string text, ModelExplorer explorer); |
|||
|
|||
IStringLocalizer GetLocalizer(ModelExplorer explorer); |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
|||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap |
|||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling |
|||
@ -1,32 +1,27 @@ |
|||
using Microsoft.Extensions.Configuration; |
|||
using System; |
|||
using Microsoft.Extensions.Configuration; |
|||
|
|||
namespace Microsoft.AspNetCore.Hosting |
|||
{ |
|||
public static class AbpHostingEnvironmentExtensions |
|||
{ |
|||
public static IConfigurationRoot BuildConfiguration(this IHostingEnvironment env, AbpAspNetCoreConfigurationOptions options = null) |
|||
public static IConfigurationRoot BuildConfiguration( |
|||
this IHostingEnvironment env, |
|||
ConfigurationBuilderOptions options = null) |
|||
{ |
|||
options = options ?? new AbpAspNetCoreConfigurationOptions(); |
|||
options = options ?? new ConfigurationBuilderOptions(); |
|||
|
|||
var builder = new ConfigurationBuilder() |
|||
.SetBasePath(env.ContentRootPath) |
|||
.AddJsonFile(options.FileName + ".json", optional: true, reloadOnChange: true) |
|||
.AddJsonFile($"{options.FileName}.{env.EnvironmentName}.json", optional: true, reloadOnChange: true) |
|||
.AddEnvironmentVariables(); |
|||
if (options.BasePath.IsNullOrEmpty()) |
|||
{ |
|||
options.BasePath = env.ContentRootPath; |
|||
} |
|||
|
|||
if (env.IsDevelopment()) |
|||
if (options.EnvironmentName.IsNullOrEmpty()) |
|||
{ |
|||
if (options.UserSecretsId != null) |
|||
{ |
|||
builder.AddUserSecrets(options.UserSecretsId); |
|||
} |
|||
else if (options.UserSecretsAssembly != null) |
|||
{ |
|||
builder.AddUserSecrets(options.UserSecretsAssembly, true); |
|||
} |
|||
options.EnvironmentName = env.EnvironmentName; |
|||
} |
|||
|
|||
return builder.Build(); |
|||
return ConfigurationHelper.BuildConfiguration(options); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,43 @@ |
|||
using System; |
|||
using System.IO; |
|||
|
|||
namespace Microsoft.Extensions.Configuration |
|||
{ |
|||
public static class ConfigurationHelper |
|||
{ |
|||
public static IConfigurationRoot BuildConfiguration(ConfigurationBuilderOptions options = null) |
|||
{ |
|||
options = options ?? new ConfigurationBuilderOptions(); |
|||
|
|||
if (options.BasePath.IsNullOrEmpty()) |
|||
{ |
|||
options.BasePath = Directory.GetCurrentDirectory(); |
|||
} |
|||
|
|||
var builder = new ConfigurationBuilder() |
|||
.SetBasePath(options.BasePath) |
|||
.AddJsonFile(options.FileName + ".json", optional: true, reloadOnChange: true); |
|||
|
|||
if (!options.EnvironmentName.IsNullOrEmpty()) |
|||
{ |
|||
builder = builder.AddJsonFile($"{options.FileName}.{options.EnvironmentName}.json", optional: true, reloadOnChange: true); |
|||
} |
|||
|
|||
builder = builder.AddEnvironmentVariables(); |
|||
|
|||
if (options.EnvironmentName == "Development") |
|||
{ |
|||
if (options.UserSecretsId != null) |
|||
{ |
|||
builder.AddUserSecrets(options.UserSecretsId); |
|||
} |
|||
else if (options.UserSecretsAssembly != null) |
|||
{ |
|||
builder.AddUserSecrets(options.UserSecretsAssembly, true); |
|||
} |
|||
} |
|||
|
|||
return builder.Build(); |
|||
} |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue