DotNetNext / SqlSugar

.Net aot ORM Fastest ORM Simple Easy VB.NET Sqlite orm Oracle ORM Mysql Orm 虚谷数据库 postgresql ORm SqlServer oRm 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET5 ORM .NET6 ORM ClickHouse orm QuestDb ,TDengine ORM,OceanBase orm,GaussDB orm ,Tidb orm Object/Relational Mapping
https://www.donet5.com/Home/Doc
MIT License
5.16k stars 1.32k forks source link

English language documentation? #1260

Closed aloksharma1 closed 1 day ago

aloksharma1 commented 4 days ago

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

DotNetNext commented 4 days ago

https://github.com/DotNetNext/SqlSugar/wiki

Efforts in writing, source code DEMO is in English

aloksharma1 commented 3 days ago

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.

DotNetNext commented 3 days ago

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
DotNetNext commented 3 days ago

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();
DotNetNext commented 1 day ago

Close it first. If you have any questions, you can post issues