Beispiel #1
0
 public static IEnumerable <HintBagAttribute> GetTypeHintBag(this IModelMemberInfo info)
 {
     if (info == null)
     {
         throw new ArgumentNullException(nameof(info));
     }
     return(GetTypeHintBag(info.GetCustomAttributes(typeof(HintBagAttribute), true)));
 }
Beispiel #2
0
 public static IDictionary <string, string> GetTypeHintBagAsDictionary(this IModelMemberInfo info)
 {
     if (info == null)
     {
         throw new ArgumentNullException(nameof(info));
     }
     return(GetTypeHintBagAsDictionary(info.GetCustomAttributes(typeof(HintBagAttribute), true)));
 }
        public MappingProperyInfo(IModelMemberInfo pInfo, Type objType)
        {
            MemberInfo       = pInfo;
            ObjectType       = objType;
            PropertyType     = pInfo.Type.GetPureType();
            PropertyTypeInfo = PropertyType.GetTypeInfo();

            CustomAttributes = pInfo.GetCustomAttributes(true).ToArray();

            Name =
                (CustomAttributes.FirstOrDefault(x => x is NameAttribute) as NameAttribute)
                ?.Name ?? pInfo.Name;

            //var evals = CustomAttributes.Where(x => x is MapperEvaluateAttribute);
        }