using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; #nullable disable namespace zhengcaioa.Models { public partial class zcwebContext : DbContext { public zcwebContext() { this.Database.SetCommandTimeout(60); } public zcwebContext(DbContextOptions options) : base(options) { } public virtual DbSet DtArticleCategories { get; set; } public virtual DbSet DtChannelArticleNews { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (!optionsBuilder.IsConfigured) { #warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263. optionsBuilder.UseSqlServer("Data Source=172.26.97.147;Initial Catalog=zcweb;User ID=sa;Password=Za20222812"); } } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.HasAnnotation("Relational:Collation", "Chinese_PRC_CI_AS"); modelBuilder.Entity(entity => { entity.ToTable("dt_article_category"); entity.HasComment("文章类别表"); entity.Property(e => e.Id) .HasColumnName("id") .HasComment("自增ID"); entity.Property(e => e.CallIndex) .HasMaxLength(50) .HasColumnName("call_index") .HasDefaultValueSql("('')") .HasComment("调用别名"); entity.Property(e => e.ChannelId) .HasColumnName("channel_id") .HasComment("频道ID"); entity.Property(e => e.ClassLayer) .HasColumnName("class_layer") .HasDefaultValueSql("((0))") .HasComment("类别深度"); entity.Property(e => e.ClassList) .HasMaxLength(500) .HasColumnName("class_list") .HasComment("类别ID列表(逗号分隔开)"); entity.Property(e => e.Content) .HasColumnType("ntext") .HasColumnName("content") .HasComment("备注说明"); entity.Property(e => e.ImgUrl) .HasMaxLength(255) .HasColumnName("img_url") .HasDefaultValueSql("('')") .HasComment("图片地址"); entity.Property(e => e.IsLock) .HasColumnName("is_lock") .HasDefaultValueSql("((0))") .HasComment("状态0正常1禁用"); entity.Property(e => e.LinkUrl) .HasMaxLength(255) .HasColumnName("link_url") .HasDefaultValueSql("('')") .HasComment("URL跳转地址"); entity.Property(e => e.ParentId) .HasColumnName("parent_id") .HasDefaultValueSql("((0))") .HasComment("父类别ID"); entity.Property(e => e.SeoDescription) .HasMaxLength(255) .HasColumnName("seo_description") .HasDefaultValueSql("('')") .HasComment("SEO描述"); entity.Property(e => e.SeoKeywords) .HasMaxLength(255) .HasColumnName("seo_keywords") .HasDefaultValueSql("('')") .HasComment("SEO关健字"); entity.Property(e => e.SeoTitle) .HasMaxLength(255) .HasColumnName("seo_title") .HasDefaultValueSql("('')") .HasComment("SEO标题"); entity.Property(e => e.SiteId) .HasColumnName("site_id") .HasDefaultValueSql("((0))") .HasComment("站点ID"); entity.Property(e => e.SortId) .HasColumnName("sort_id") .HasDefaultValueSql("((99))") .HasComment("排序数字"); entity.Property(e => e.Title) .HasMaxLength(100) .HasColumnName("title") .HasComment("类别标题"); }); modelBuilder.Entity(entity => { entity.ToTable("dt_channel_article_news"); entity.Property(e => e.Id).HasColumnName("id"); entity.Property(e => e.AddTime) .HasColumnType("datetime") .HasColumnName("add_time") .HasDefaultValueSql("(getdate())"); entity.Property(e => e.Author) .HasMaxLength(50) .HasColumnName("author"); entity.Property(e => e.CallIndex) .HasMaxLength(50) .HasColumnName("call_index"); entity.Property(e => e.CategoryId).HasColumnName("category_id"); entity.Property(e => e.ChannelId).HasColumnName("channel_id"); entity.Property(e => e.Click).HasColumnName("click"); entity.Property(e => e.Content) .HasColumnType("ntext") .HasColumnName("content"); entity.Property(e => e.ImgUrl) .HasMaxLength(255) .HasColumnName("img_url"); entity.Property(e => e.IsHot).HasColumnName("is_hot"); entity.Property(e => e.IsMsg).HasColumnName("is_msg"); entity.Property(e => e.IsRed).HasColumnName("is_red"); entity.Property(e => e.IsSlide).HasColumnName("is_slide"); entity.Property(e => e.IsSys).HasColumnName("is_sys"); entity.Property(e => e.IsTop).HasColumnName("is_top"); entity.Property(e => e.LikeCount).HasColumnName("like_count"); entity.Property(e => e.LinkUrl) .HasMaxLength(255) .HasColumnName("link_url"); entity.Property(e => e.SeoDescription) .HasMaxLength(255) .HasColumnName("seo_description"); entity.Property(e => e.SeoKeywords) .HasMaxLength(255) .HasColumnName("seo_keywords"); entity.Property(e => e.SeoTitle) .HasMaxLength(255) .HasColumnName("seo_title"); entity.Property(e => e.SiteId).HasColumnName("site_id"); entity.Property(e => e.SortId) .HasColumnName("sort_id") .HasDefaultValueSql("((99))"); entity.Property(e => e.Source) .HasMaxLength(50) .HasColumnName("source"); entity.Property(e => e.Status).HasColumnName("status"); entity.Property(e => e.Tags) .HasMaxLength(500) .HasColumnName("tags"); entity.Property(e => e.Title) .HasMaxLength(100) .HasColumnName("title"); entity.Property(e => e.UpdateTime) .HasColumnType("datetime") .HasColumnName("update_time"); entity.Property(e => e.UserName) .HasMaxLength(100) .HasColumnName("user_name"); entity.Property(e => e.Zhaiyao) .HasMaxLength(255) .HasColumnName("zhaiyao"); }); OnModelCreatingPartial(modelBuilder); } partial void OnModelCreatingPartial(ModelBuilder modelBuilder); } }