Closed aloksharma1 closed 1 day ago
https://github.com/DotNetNext/SqlSugar/wiki
Efforts in writing, source code DEMO is in English
https://github.com/DotNetNext/SqlSugar/wiki
Efforts in writing, source code DEMO is in English
thanks for the quick response, does your orm also supports runtime migrations. i want to add/modify/delete db tables & columns at runtime and reuse them dynamically with DynamicBuilder.
1、Migration is run time db.CodeFirst.InitTables(Type[]) 2、Supports dynamic CRUD https://www.donet5.com/Home/Doc?typeId=2422 This piece is still in Chinese, and I will try to sort out the English ones later
Type[] types= typeof(class of any entity class).assembly.GetTypes()
.where (it=> it.fullname.contains ("OrmTest."))// Namespace filters, but you can also write other conditional filters
.ToArray();//Get in bulk types
If there is no class, it can be created dynamically
var type = db.DynamicBuilder().CreateClass("table1", new SugarTable()
{
})
.CreateProperty("Id", typeof(int),new SugarColumn() {IsPrimaryKey=true,IsIdentity=true })
.CreateProperty("Name",typeof(string), new SugarColumn() { })
.WithCache()//cache
.BuilderType();
db.CodeFirst.InitTables(type);
var dic= new Dictionary<string, object>(){{"Id",1},{"Name","jack"} };
var value= db.DynamicBuilder().CreateObjectByType(type,dic);
db.InsertableByObject(value).ExecuteCommand();
db.UpdateableByObject(value).ExecuteCommand();
db.DeleteableByObject(value).ExecuteCommand();
db.StorageableByObject(value).ExecuteCommand();//insert or update
db.QueryableByObject(type).ToList();
Close it first. If you have any questions, you can post issues
Hello, i came here trying to find better alternatives for ef core and this looks promising. Problem is all documentation is in chinese, do you have a link for english translated documentation?
thanks