mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 04:35:29 +08:00
Update linq to sql
This commit is contained in:
parent
81b619cd7a
commit
682b2dc055
@ -33,5 +33,10 @@ namespace SqlSugar
|
||||
public ConditionalType ConditionalType { get; set; }
|
||||
[Newtonsoft.Json.JsonIgnoreAttribute]
|
||||
public Func<string,object> FieldValueConvertFunc { get; set; }
|
||||
|
||||
public static List<IConditionalModel> Create(params IConditionalModel[] conditionalModel)
|
||||
{
|
||||
return conditionalModel.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,5 +22,6 @@ namespace SqlSugar
|
||||
public bool SqlServerCodeFirstNvarchar { get; set; }
|
||||
public bool IsAutoUpdateQueryFilter { get; set; }
|
||||
public bool IsAutoDeleteQueryFilter { get; set; }
|
||||
public bool EnableModelFuncMappingColumn { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace SqlSugar
|
||||
@ -8,6 +9,11 @@ namespace SqlSugar
|
||||
{
|
||||
public string FuncName { get; set; }
|
||||
public List<object> Parameters { get; set; }
|
||||
|
||||
public static ObjectFuncModel Create(string FuncName, params object[] Parameters)
|
||||
{
|
||||
return new ObjectFuncModel() { FuncName = FuncName, Parameters = Parameters?.ToList() };
|
||||
}
|
||||
}
|
||||
public class ArrayFuncModel: IFuncModel
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace SqlSugar
|
||||
@ -7,5 +8,9 @@ namespace SqlSugar
|
||||
public class GroupByModel
|
||||
{
|
||||
public string FieldName { get; set; }
|
||||
public static List<GroupByModel> Create(params GroupByModel[] groupModels)
|
||||
{
|
||||
return groupModels.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace SqlSugar
|
||||
@ -8,5 +9,9 @@ namespace SqlSugar
|
||||
{
|
||||
public string FieldName { get; set; }
|
||||
public OrderByType OrderByType { get; set; }
|
||||
public static List<OrderByModel> Create(params OrderByModel[] orderByModel)
|
||||
{
|
||||
return orderByModel.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace SqlSugar
|
||||
@ -8,5 +9,10 @@ namespace SqlSugar
|
||||
{
|
||||
public object FiledName { get; set; }
|
||||
public string AsName { get; set; }
|
||||
|
||||
public static List<SelectModel> Create(params SelectModel[] SelectModels)
|
||||
{
|
||||
return SelectModels.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,15 @@ namespace SqlSugar
|
||||
var resSql = "";
|
||||
var resPars = new List<SugarParameter>();
|
||||
resSql = GetSql(parameters, dbMethods, methodName, methodInfo, pars, resPars);
|
||||
if (name.EqualCase("MappingColumn"))
|
||||
{
|
||||
if (!(this.Context?. CurrentConnectionConfig?.MoreSettings?.EnableModelFuncMappingColumn == true))
|
||||
{
|
||||
Check.ExceptionEasy("Enable MappingColumn need in ConnectionConfig - > MoreSettings - > EnableModelFuncMappingColumn set to true", "MappingColumn考虑到风险情况需要开启才能使用,请在 ConnectionConfig->MoreSettings->EnableModelFuncMappingColumn设置为true");
|
||||
}
|
||||
resSql= resSql.TrimEnd(Convert.ToChar( this.SqlTranslationRight))
|
||||
.TrimStart(Convert.ToChar(this.SqlTranslationLeft));
|
||||
}
|
||||
return new KeyValuePair<string, SugarParameter[]>(resSql, resPars.ToArray());
|
||||
}
|
||||
#endregion
|
||||
|
@ -207,6 +207,7 @@ namespace SqlSugar
|
||||
IsAutoToUpper=it.MoreSettings.IsAutoToUpper,
|
||||
IsAutoDeleteQueryFilter=it.MoreSettings.IsAutoDeleteQueryFilter,
|
||||
IsAutoUpdateQueryFilter = it.MoreSettings.IsAutoUpdateQueryFilter,
|
||||
EnableModelFuncMappingColumn=it.MoreSettings.EnableModelFuncMappingColumn
|
||||
|
||||
},
|
||||
SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle
|
||||
|
Loading…
Reference in New Issue
Block a user