public string SaveObjectForDownload <T>(T @object) { var fileAlias = LocalStore.NewFile(); using (var streamWriter = new StreamWriter(LocalStore.OpenWrite(fileAlias))) { XmlProvider.Write(@object, Encoding.Unicode, streamWriter); } return(fileAlias); }
public static string UploadObject <T>(this IFileTransferClient client, T @object, bool compress = false) { var fileAlias = client.LocalStore.NewFile(); using (var streamWriter = new StreamWriter(client.LocalStore.OpenWrite(fileAlias))) { XmlProvider.Write(@object, Encoding.Unicode, streamWriter); } client.UploadFile(fileAlias, client.LocalStore.GetFilePath(fileAlias)); return(fileAlias); }