예제 #1
0
        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);
            }
        }
예제 #2
0
        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));
        }