mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 18:48:09 +08:00
-
This commit is contained in:
@@ -12,7 +12,20 @@ namespace OrmTest.Demo
|
||||
{
|
||||
var db = GetInstance();
|
||||
//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 ILambdaExpressions _LambdaExpressions;
|
||||
protected IRewritableMethods _RewritableMethods;
|
||||
protected IDbFirst _DbFirst;
|
||||
protected ICodeFirst _CodeFirst;
|
||||
protected IDbMaintenance _DbMaintenance;
|
||||
#endregion
|
||||
|
||||
|
@@ -227,15 +227,11 @@ namespace SqlSugar
|
||||
public virtual IDbFirst DbFirst
|
||||
{
|
||||
get
|
||||
{
|
||||
if (base._DbFirst == null)
|
||||
{
|
||||
IDbFirst dbFirst = InstanceFactory.GetDbFirst(this.Context.CurrentConnectionConfig);
|
||||
base._DbFirst = dbFirst;
|
||||
dbFirst.Context = this.Context;
|
||||
dbFirst.Init();
|
||||
}
|
||||
return base._DbFirst;
|
||||
return dbFirst;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -244,14 +240,10 @@ namespace SqlSugar
|
||||
public virtual ICodeFirst CodeFirst
|
||||
{
|
||||
get
|
||||
{
|
||||
if (base._CodeFirst == null)
|
||||
{
|
||||
ICodeFirst codeFirst = InstanceFactory.GetCodeFirst(this.Context.CurrentConnectionConfig);
|
||||
base._CodeFirst = codeFirst;
|
||||
codeFirst.Context = this.Context;
|
||||
}
|
||||
return base._CodeFirst;
|
||||
return codeFirst;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
Reference in New Issue
Block a user