mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-16 16:50:41 +08:00
performance optimization
This commit is contained in:
parent
2b98357cf1
commit
d96d00c97c
@ -16,7 +16,7 @@ namespace OrmTest.Models
|
|||||||
public int? SchoolId { get; set; }
|
public int? SchoolId { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public DateTime? CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
[SugarColumn(IsIgnore=true)]
|
[SugarColumn(IsIgnore=true,NoSerialize =true)]
|
||||||
public int TestId { get; set; }
|
public int TestId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,12 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
|
protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
|
||||||
|
{
|
||||||
|
if (type.IsAnonymousType()||type==UtilConstants.ObjType|| type.Namespace=="SqlSugar"|| type.IsClass()==false)
|
||||||
|
{
|
||||||
|
return base.CreateProperties(type, memberSerialization);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
var list = type.GetProperties()
|
var list = type.GetProperties()
|
||||||
.Where(x => !x.GetCustomAttributes(true).Any(a => (a is SugarColumn) && ((SugarColumn)a).NoSerialize == true))
|
.Where(x => !x.GetCustomAttributes(true).Any(a => (a is SugarColumn) && ((SugarColumn)a).NoSerialize == true))
|
||||||
@ -54,6 +60,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void CreateDateProperty(Type type, JsonProperty item)
|
private static void CreateDateProperty(Type type, JsonProperty item)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user