mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
PgSql update exp to sql
This commit is contained in:
parent
85fdcb11e9
commit
6e985d8834
@ -177,7 +177,8 @@ namespace OrmTest
|
||||
|
||||
var list4 = db.Queryable<ABMapping>()
|
||||
.Mapper(it => it.A, it => it.AId)
|
||||
.Mapper(it => it.B, it => it.BId).ToList();
|
||||
.Mapper(it => it.B, it => it.BId)
|
||||
.Where(it => it.A.Id == 1).ToList();
|
||||
|
||||
//Manual mode
|
||||
var result = db.Queryable<OrderInfo>().Take(10).Select<ViewOrder>().Mapper((itemModel, cache) =>
|
||||
|
@ -45,6 +45,11 @@ namespace SqlSugar
|
||||
}
|
||||
public override string GetTranslationColumnName(string propertyName)
|
||||
{
|
||||
if (propertyName.Contains(".")&& !propertyName.Contains(SqlTranslationLeft))
|
||||
{
|
||||
return string.Join(".", propertyName.Split('.').Select(it => $"{SqlTranslationLeft}{it.ToLower(isAutoToLower)}{SqlTranslationRight}"));
|
||||
}
|
||||
|
||||
if (propertyName.Contains(SqlTranslationLeft)) return propertyName;
|
||||
else
|
||||
return SqlTranslationLeft + propertyName.ToLower(isAutoToLower) + SqlTranslationRight;
|
||||
|
@ -168,7 +168,8 @@ namespace OrmTest
|
||||
|
||||
var list4 = db.Queryable<ABMapping>()
|
||||
.Mapper(it => it.A, it => it.AId)
|
||||
.Mapper(it => it.B, it => it.BId).ToList();
|
||||
.Mapper(it => it.B, it => it.BId)
|
||||
.Where(it=>it.A.Id==1).ToList();
|
||||
|
||||
//Manual mode
|
||||
var result = db.Queryable<OrderInfo>().Take(10).Select<ViewOrder>().Mapper((itemModel, cache) =>
|
||||
|
@ -45,6 +45,11 @@ namespace SqlSugar
|
||||
}
|
||||
public override string GetTranslationColumnName(string propertyName)
|
||||
{
|
||||
if (propertyName.Contains(".")&& !propertyName.Contains(SqlTranslationLeft))
|
||||
{
|
||||
return string.Join(".", propertyName.Split('.').Select(it => $"{SqlTranslationLeft}{it.ToLower(isAutoToLower)}{SqlTranslationRight}"));
|
||||
}
|
||||
|
||||
if (propertyName.Contains(SqlTranslationLeft)) return propertyName;
|
||||
else
|
||||
return SqlTranslationLeft + propertyName.ToLower(isAutoToLower) + SqlTranslationRight;
|
||||
|
Loading…
Reference in New Issue
Block a user