修改了一下启动的默认是否启用读写分离
This commit is contained in:
parent
9acbe8d42d
commit
fbe7207b86
|
@ -7,5 +7,6 @@ namespace Sample.SqlServerShardingTable.Entities
|
|||
public long Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public bool IsDelete { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace Sample.SqlServerShardingTable
|
|||
entity.HasKey(o => o.Id);
|
||||
entity.Property(o => o.Id).ValueGeneratedNever();
|
||||
entity.Property(o=>o.Name).IsRequired().IsUnicode(false).HasMaxLength(50);
|
||||
entity.HasQueryFilter(o => o.IsDelete == false);
|
||||
entity.ToTable(nameof(MultiShardingOrder));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace ShardingCore.Test
|
|||
}
|
||||
}
|
||||
};
|
||||
},ReadStrategyEnum.Loop,readConnStringGetStrategy:ReadConnStringGetStrategyEnum.LatestEveryTime)
|
||||
},ReadStrategyEnum.Loop,defaultEnable: false, readConnStringGetStrategy:ReadConnStringGetStrategyEnum.LatestEveryTime)
|
||||
.AddTableEnsureManager(sp=>new SqlServerTableEnsureManager<ShardingDefaultDbContext>())
|
||||
.End();
|
||||
// services.AddShardingDbContext<ShardingDefaultDbContext, DefaultDbContext>(o => o.UseMySql(hostBuilderContext.Configuration.GetSection("MySql")["ConnectionString"],new MySqlServerVersion("5.7.15"))
|
||||
|
|
Loading…
Reference in New Issue