Пример #1
0
        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));
        }
Пример #2
0
        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)));
        }
Пример #3
0
        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)));
        }
Пример #4
0
        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)));
        }