Пример #1
0
 public ContentView(string text, string title, ContentData[] contentData, int id)
 {
     this.text = text;
     this.title = title;
     this.contentData = contentData;
     this.id = id;
     tags = null;
 }
Пример #2
0
 public ContentView(string text, string title, ContentData[] contentData, int id, string[] tags)
 {
     this.text = text;
     this.title = title;
     this.contentData = contentData;
     this.id = id;
     this.tags = tags;
 }
 public String PostImage(HttpPostedFileBase fileBase, int content_id)
 {
     if (fileBase.ContentLength > 0)
     {
         CloudBlobContainer container = myBlobStorageService.getCloudBlobContainer();
         CloudBlockBlob blob = container.GetBlockBlobReference(String.Format("img_{0}.jpg", DateTime.Now.ToString("yyyyMMddHHmmssfff")));
         blob.UploadFromStream(fileBase.InputStream);
         ContentData cd = new ContentData(content_id, blob.Uri.ToString(),0);
         db.ContentDatas.Add(cd);
         db.SaveChanges();
         return blob.Uri.ToString();
     }
     return null;
 }