mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 04:23:47 +08:00
Update Pg
This commit is contained in:
@@ -53,7 +53,7 @@ namespace OrmTest.Demo
|
|||||||
//db.CodeFirst.BackupTable().InitTables(typeof(CodeTable),typeof(CodeTable2));
|
//db.CodeFirst.BackupTable().InitTables(typeof(CodeTable),typeof(CodeTable2));
|
||||||
|
|
||||||
//No backup table
|
//No backup table
|
||||||
// db.CodeFirst.SetStringDefaultLength(10).InitTables(typeof(CodeTable),typeof(CodeTable2));
|
db.CodeFirst.SetStringDefaultLength(10).InitTables(typeof(CodeTable),typeof(CodeTable2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,28 +12,28 @@ namespace OrmTest.Demo
|
|||||||
{
|
{
|
||||||
var db = GetInstance();
|
var db = GetInstance();
|
||||||
//Create all class
|
//Create all class
|
||||||
db.DbFirst.CreateClassFile("c:\\Demo\\1");
|
db.DbFirst.CreateClassFile("c:\\PgDemo\\1");
|
||||||
|
|
||||||
//Create student calsss
|
//Create student calsss
|
||||||
db.DbFirst.Where("Student").CreateClassFile("c:\\Demo\\2");
|
db.DbFirst.Where("Student").CreateClassFile("c:\\PgDemo\\2");
|
||||||
//Where(array)
|
//Where(array)
|
||||||
|
|
||||||
//Mapping name
|
//Mapping name
|
||||||
db.MappingTables.Add("ClassStudent", "Student");
|
db.MappingTables.Add("ClassStudent", "Student");
|
||||||
db.MappingColumns.Add("NewId", "Id", "ClassStudent");
|
db.MappingColumns.Add("NewId", "Id", "ClassStudent");
|
||||||
db.DbFirst.Where("Student").CreateClassFile("c:\\Demo\\3");
|
db.DbFirst.Where("Student").CreateClassFile("c:\\PgDemo\\3");
|
||||||
|
|
||||||
//Remove mapping
|
//Remove mapping
|
||||||
db.MappingTables.Clear();
|
db.MappingTables.Clear();
|
||||||
|
|
||||||
//Create class with default value
|
//Create class with default value
|
||||||
db.DbFirst.IsCreateDefaultValue().CreateClassFile("c:\\Demo\\4", "Demo.Models");
|
db.DbFirst.IsCreateDefaultValue().CreateClassFile("c:\\PgDemo\\4", "Demo.Models");
|
||||||
|
|
||||||
|
|
||||||
//Mapping and Attribute
|
//Mapping and Attribute
|
||||||
db.MappingTables.Add("ClassStudent", "Student");
|
db.MappingTables.Add("ClassStudent", "Student");
|
||||||
db.MappingColumns.Add("NewId", "Id", "ClassStudent");
|
db.MappingColumns.Add("NewId", "Id", "ClassStudent");
|
||||||
db.DbFirst.IsCreateAttribute().Where("Student").CreateClassFile("c:\\Demo\\5");
|
db.DbFirst.IsCreateAttribute().Where("Student").CreateClassFile("c:\\PgDemo\\5");
|
||||||
|
|
||||||
|
|
||||||
//Remove mapping
|
//Remove mapping
|
||||||
@@ -66,7 +66,7 @@ namespace OrmTest.Demo
|
|||||||
{
|
{
|
||||||
return old;
|
return old;
|
||||||
})
|
})
|
||||||
.CreateClassFile("c:\\Demo\\6");
|
.CreateClassFile("c:\\PgDemo\\6");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
Demo.DbFirst.Init();
|
||||||
Demo.CodeFirst.Init();
|
Demo.CodeFirst.Init();
|
||||||
Demo.Aop.Init();
|
Demo.Aop.Init();
|
||||||
Demo.Query.Init();
|
Demo.Query.Init();
|
||||||
|
Reference in New Issue
Block a user