/// <summary> /// Constructor /// </summary> /// <param name="part">HttpParts</param> public HttpPartAttribute(HttpParts part) { Part = part; }
/// <summary> /// Find the PropertyInfo for the matching property /// </summary> /// <param name="properties">Ienumerable with PropertyInfo</param> /// <param name="part">HttpParts specifying which property to find</param> /// <param name="propertyInfo">PropertyInfo out parameter</param> /// <returns>bool if found</returns> private static bool TryFindTarget(this IEnumerable <PropertyInfo> properties, HttpParts part, out PropertyInfo propertyInfo) { propertyInfo = properties.FirstOrDefault(t => t.GetCustomAttribute <HttpPartAttribute>().Part == part); return(propertyInfo != null); }