本文整理汇总了C#中System.TypeExtension类的典型用法代码示例。如果您正苦于以下问题:C# TypeExtension类的具体用法?C# TypeExtension怎么用?C# TypeExtension使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeExtension类属于System命名空间,在下文中一共展示了TypeExtension类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetValue
private static object GetValue(TypeExtension typeExtension, MemberAccessor member, string elemName, out bool isSet)
{
var value = typeExtension[member.Name][elemName].Value;
isSet = value != null;
return value;
}
示例2: GetMapIgnore
public virtual bool GetMapIgnore(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
isSet = false;
return
TypeHelper.IsScalar(member.Type) == false;// ||
//(member.MemberInfo is FieldInfo && ((FieldInfo)member.MemberInfo).IsLiteral);
}
示例3: GetInheritanceDiscriminator
public override bool GetInheritanceDiscriminator(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
var value = GetValue(typeExtension, member, "IsInheritanceDiscriminator", out isSet);
if (value != null)
return TypeExtension.ToBoolean(value);
return base.GetInheritanceDiscriminator(typeExtension, member, out isSet);
}
示例4: GetFieldStorage
public override string GetFieldStorage(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
var value = GetValue(typeExtension, member, "FieldStorage", out isSet);
if (value != null)
return value.ToString();
return base.GetFieldStorage(typeExtension, member, out isSet);
}
示例5: GetMapIgnore
public override bool GetMapIgnore(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
var value = GetValue(typeExtension, member, "MapIgnore", out isSet);
if (value != null)
return TypeExtension.ToBoolean(value);
return base.GetMapIgnore(typeExtension, member, out isSet) || GetAssociation(typeExtension, member) != null;
}
示例6: GetFieldStorage
public override string GetFieldStorage(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
foreach (var p in _list)
{
var name = p.GetFieldStorage(typeExtension, member, out isSet);
if (isSet)
return name;
}
return base.GetFieldStorage(typeExtension, member, out isSet);
}
示例7: GetInheritanceDiscriminator
public override bool GetInheritanceDiscriminator(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
foreach (var p in _list)
{
var value = p.GetInheritanceDiscriminator(typeExtension, member, out isSet);
if (isSet)
return value;
}
return base.GetInheritanceDiscriminator(typeExtension, member, out isSet);
}
示例8: GetFieldStorage
public override string GetFieldStorage(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
if (IsLinqObject(member.TypeAccessor.Type))
{
var a = member.GetAttribute<ColumnAttribute>();
if (a != null && !string.IsNullOrEmpty(a.Name))
{
isSet = true;
return a.Storage;
}
}
return base.GetFieldStorage(typeExtension, member, out isSet);
}
示例9: GetFieldStorage
public override string GetFieldStorage(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
var a = member.GetAttribute<MapFieldAttribute>();
if (a != null)
{
isSet = true;
return a.Storage;
}
foreach (MapFieldAttribute attr in GetMapFieldAttributes(member.TypeAccessor))
{
if (string.Equals(attr.OrigName, member.Name, StringComparison.InvariantCultureIgnoreCase))
{
isSet = true;
return attr.Storage;
}
}
return base.GetFieldStorage(typeExtension, member, out isSet);
}
示例10: GetFieldStorage
public virtual string GetFieldStorage(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
isSet = false;
return null;
}
示例11: GetFieldName
public virtual string GetFieldName(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
isSet = false;
return member.Name;
}
示例12: GetInheritanceMapping
public virtual InheritanceMappingAttribute[] GetInheritanceMapping(Type type, TypeExtension typeExtension)
{
return Array<InheritanceMappingAttribute>.Empty;
}
示例13: GetAssociation
public virtual Association GetAssociation(TypeExtension typeExtension, MemberAccessor member)
{
return null;
}
示例14: GetPrimaryKeyFields
protected static List<string> GetPrimaryKeyFields(MappingSchema schema, TypeAccessor ta, TypeExtension tex)
{
var mdp = schema.MetadataProvider;
var keys = new List<string>();
foreach (MemberAccessor sma in ta)
{
bool isSetFlag;
mdp.GetPrimaryKeyOrder(ta.Type, tex, sma, out isSetFlag);
if (isSetFlag)
{
var name = mdp.GetFieldName(tex, sma, out isSetFlag);
keys.Add(name);
}
}
return keys;
}
示例15: GetSqlIgnore
public virtual bool GetSqlIgnore(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
isSet = false;
return false;
}