Exemplo n.º 1
0
        public void Configure(EntityTypeBuilder <Domain.Entity.View.Common.TagGroupReady> tagGroupReadyConfiguration)
        {
            //RelationalEntityTypeBuilderExtensions.ToView((EntityTypeBuilder) tagGroupReadyConfiguration, "TagGroupReadyView", KSociety.Base.Infra.Shared.Class.DatabaseContext.DefaultSchema);
            RelationalEntityTypeBuilderExtensions.ToView((EntityTypeBuilder)tagGroupReadyConfiguration, "TagGroupReadyView");

            tagGroupReadyConfiguration.HasNoKey();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 设置视图名称和Schema [Set the view name and Schema]
        /// 优先级:
        /// * 传入的 tableName 和 schema
        /// * 实体标记的 TableAttribute
        /// * 实体名称, schema 不设置
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="viewName"></param>
        /// <param name="schema"></param>
        /// <returns></returns>
        public static EntityTypeBuilder SetViewName(
            this EntityTypeBuilder builder,
            string viewName = null,
            string schema   = null)
        {
            if (!string.IsNullOrWhiteSpace(viewName))
            {
                return(RelationalEntityTypeBuilderExtensions.ToView(builder, C(viewName), C(schema)));
            }

            var tableAttr = builder.Metadata.ClrType.GetTableAttribute();

            if (tableAttr != null)
            {
                return(RelationalEntityTypeBuilderExtensions.ToView(builder, C(tableAttr.Name), C(tableAttr.Schema)));
            }
            return(RelationalEntityTypeBuilderExtensions.ToView(builder, C(builder.Metadata.ClrType.Name)));
        }
Exemplo n.º 3
0
 public void Configure(EntityTypeBuilder <Domain.Entity.View.Joined.AllConnection> allConnectionConfiguration)
 {
     //RelationalEntityTypeBuilderExtensions.ToView((EntityTypeBuilder) allConnectionConfiguration, "AllConnectionView", KSociety.Base.Infra.Shared.Class.DatabaseContext.DefaultSchema);
     RelationalEntityTypeBuilderExtensions.ToView((EntityTypeBuilder)allConnectionConfiguration, "AllConnectionView");
     allConnectionConfiguration.HasNoKey();
 }