public static void Convert <C>(C content, IContentResult result) { ContentConverterAttribute attribute = result.GetType().GetTypeInfo().GetCustomAttribute <ContentConverterAttribute>(); if (attribute != null) { attribute.Convert(content as Content, result); } }
public static C Convert <C>(IContentResult result) { ContentConverterAttribute attribute = result.GetType().GetTypeInfo().GetCustomAttribute <ContentConverterAttribute>(); if (attribute != null) { return((C)attribute.Convert(result)); } return(default(C)); }