public static T ConvertTo <T>(this IAttachment source) where T : IAttachment, new() { var target = new T(); source.CopyTo(target); return(target); }