Exemplo n.º 1
0
 public void Post(IResource resource, string username)
 {
     var user = this.users.All().FirstOrDefault(u => u.UserName == username);
     var dropboxClient = new DropBoxClient(AuthorizationConstants.DropboxAppKey, AuthorizationConstants.DropboxAppSecret);
     string storeUrl = dropboxClient.Upload(resource, Guid.NewGuid() + ".jpg");
     user.AvatarUrl = storeUrl;
     this.users.SaveChanges();
 }
Exemplo n.º 2
0
 public void Delete(string username)
 {
     this.users.All()
         .FirstOrDefault(u => u.UserName == username)
         .AvatarUrl = null;
     var dropboxClient = new DropBoxClient(AuthorizationConstants.DropboxAppKey, AuthorizationConstants.DropboxAppSecret);
     //// TODO: delete image from dropbox;
 }