示例#1
0
 private static HttpResponseMessageSettingsAttribute[] GetResponseSetters(MethodReflector mr, TypeReflector tr)
 {
     return(mr.GetCustomAttributes <HttpResponseMessageSettingsAttribute>()
            .Union(mr.Parameters.SelectMany(i => i.GetCustomAttributes <ParameterResponseMessageSettingsAttribute>()
                                            .Select(j =>
     {
         j.Parameter = i.MemberInfo;
         return j;
     })))
            .Union(tr.GetCustomAttributes <HttpResponseMessageSettingsAttribute>())
            .OrderBy(i => i.Order)
            .ToArray());
 }
示例#2
0
 private static IHttpRequestMessageSettings[] GetRequestSetters(MethodReflector mr, TypeReflector tr)
 {
     return(mr.GetCustomAttributesDistinctBy <HttpMethodAttribute>(tr)
            .Select(i => i.CreateSettings(mr.Parameters.Where(j => j.IsDefined <RouteAttribute>()), mr.Parameters.Where(j => j.IsDefined <QueryAttribute>())))
            .First()
            .Union(mr.Parameters.SelectMany(i => i.GetCustomAttributes <ParameterRequestMessageSettingsAttribute>()
                                            .Select(j =>
     {
         j.Parameter = i.MemberInfo;
         return j;
     })))
            .Union(tr.GetCustomAttributes <HttpRequestMessageSettingsAttribute>())
            .Union(mr.GetCustomAttributes <HttpRequestMessageSettingsAttribute>())
            .OrderBy(i => i.Order)
            .ToArray());
 }
示例#3
0
 public IEnumerable <Attribute> AspectCore_Reflector_GetCustomAttributes_WithAttrType()
 {
     return(_reflector.GetCustomAttributes(typeof(Attribute1)));
 }