public FileStreamResult Export([Required, FromBody] Lite <IUserAssetEntity>[] lites) { var bytes = UserAssetsExporter.ToXml(lites.RetrieveFromListOfLite().ToArray()); string typeName = lites.Select(a => a.EntityType).Distinct().SingleEx().Name; var fileName = "{0}{1}.xml".FormatWith(typeName, lites.ToString(a => a.Id.ToString(), "_")); return(FilesController.GetFileStreamResult(new MemoryStream(bytes), fileName)); }
public FileResult Export(Lite <IUserAssetEntity> entity) { var result = UserAssetsExporter.ToXml(entity.Retrieve()); return(File(result, MimeMapping.GetMimeMapping("xml"), "{0}{1}.xml".FormatWith(entity.EntityType.Name, entity.Id))); }
public FileStreamResult Export([Required, FromBody] Lite <IUserAssetEntity> lite) { var bytes = UserAssetsExporter.ToXml(lite.RetrieveAndRemember()); return(FilesController.GetFileStreamResult(new MemoryStream(bytes), "{0}{1}.xml".FormatWith(lite.EntityType.Name, lite.Id))); }
public HttpResponseMessage Export(Lite <IUserAssetEntity> lite) { var bytes = UserAssetsExporter.ToXml(lite.Retrieve()); return(FilesController.GetHttpReponseMessage(new MemoryStream(bytes), "{0}{1}.xml".FormatWith(lite.EntityType.Name, lite.Id))); }