コード例 #1
0
        public async Task DeletePictureFile(string webRootPath, WS_Pictures picture)
        {
            var fileLocation = picture.Url.Replace("http://webshop.nillertron.com/", "");
            var path         = Path.Combine(webRootPath, fileLocation);

            File.Delete(path);
        }
コード例 #2
0
        public async Task <WS_Pictures> SaveFile(IFileListEntry file, string webPath)
        {
            var path = Path.Combine(webPath, "images");

            path = Path.Combine(path, file.Name);
            var img = new WS_Pictures {
                Url = Path.Combine("http://webshop.nillertron.com/images", file.Name)
            };

            using (var fs = new FileStream(path, FileMode.CreateNew))
            {
                await file.Data.CopyToAsync(fs);
            }

            return(img);
        }
コード例 #3
0
 public async Task DeletePictureDb(WS_Pictures picture)
 {
     await dbService.Repository.Delete(picture);
 }