mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-21 02:58:05 +08:00
-
This commit is contained in:
@@ -12,7 +12,20 @@ namespace OrmTest.Demo
|
|||||||
{
|
{
|
||||||
var db = GetInstance();
|
var db = GetInstance();
|
||||||
//Create all class
|
//Create all class
|
||||||
db.DbFirst.CreateClassFile("c:\\Demo\\all");
|
db.DbFirst.CreateClassFile("c:\\Demo\\1");
|
||||||
|
|
||||||
|
//Create student calsss
|
||||||
|
db.DbFirst.Where("Student").CreateClassFile("c:\\Demo\\2");
|
||||||
|
|
||||||
|
//Mapping name
|
||||||
|
db.MappingTables.Add("ClassStudent", "Student");
|
||||||
|
db.DbFirst.Where("Student").CreateClassFile("c:\\Demo\\3");
|
||||||
|
|
||||||
|
//Remove mapping
|
||||||
|
db.MappingTables.Clear();
|
||||||
|
|
||||||
|
//Create class with default value
|
||||||
|
db.DbFirst.IsCreateDefaultValue().CreateClassFile("c:\\Demo\\4");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -25,8 +25,6 @@ namespace SqlSugar
|
|||||||
protected IAdo _Ado;
|
protected IAdo _Ado;
|
||||||
protected ILambdaExpressions _LambdaExpressions;
|
protected ILambdaExpressions _LambdaExpressions;
|
||||||
protected IRewritableMethods _RewritableMethods;
|
protected IRewritableMethods _RewritableMethods;
|
||||||
protected IDbFirst _DbFirst;
|
|
||||||
protected ICodeFirst _CodeFirst;
|
|
||||||
protected IDbMaintenance _DbMaintenance;
|
protected IDbMaintenance _DbMaintenance;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@@ -228,14 +228,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (base._DbFirst == null)
|
IDbFirst dbFirst = InstanceFactory.GetDbFirst(this.Context.CurrentConnectionConfig);
|
||||||
{
|
dbFirst.Context = this.Context;
|
||||||
IDbFirst dbFirst = InstanceFactory.GetDbFirst(this.Context.CurrentConnectionConfig);
|
dbFirst.Init();
|
||||||
base._DbFirst = dbFirst;
|
return dbFirst;
|
||||||
dbFirst.Context = this.Context;
|
|
||||||
dbFirst.Init();
|
|
||||||
}
|
|
||||||
return base._DbFirst;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -245,13 +241,9 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (base._CodeFirst == null)
|
ICodeFirst codeFirst = InstanceFactory.GetCodeFirst(this.Context.CurrentConnectionConfig);
|
||||||
{
|
codeFirst.Context = this.Context;
|
||||||
ICodeFirst codeFirst = InstanceFactory.GetCodeFirst(this.Context.CurrentConnectionConfig);
|
return codeFirst;
|
||||||
base._CodeFirst = codeFirst;
|
|
||||||
codeFirst.Context = this.Context;
|
|
||||||
}
|
|
||||||
return base._CodeFirst;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
Reference in New Issue
Block a user