예제 #1
0
        public void AddFacebookComment(FacebookUser fbUser, string comment, PublishedArticles article)
        {
            var fbPost = new FacebookPost();
            fbPost.articleId = article.articleId;
            fbPost.facebookId = fbUser.facebookId;
            fbPost.post = comment;

            _dataModel.AddToFacebookPosts(fbPost);
        }
예제 #2
0
 public FacebookUser AddFacebookUser(long facebookId, string accessToken, string name, string gender)
 {
     var fbUsers = _dataModel.FacebookUsers.Where(f => f.facebookId == facebookId);
     if (fbUsers.Count() == 0)
     {
         //add fbuser to db
         var fbu = new FacebookUser();
         fbu.facebookId = facebookId;
         fbu.accessToken = accessToken;
         fbu.gender = gender;
         fbu.name = name;
         fbu.firstlogin = DateTime.Now;
         fbu.lastlogin = DateTime.Now;
         _dataModel.AddToFacebookUsers(fbu);
         _dataModel.SaveChanges();
         return fbu;
     }
     else
     {
         //update last login date
         return fbUsers.First();
     }
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the FacebookUsers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToFacebookUsers(FacebookUser facebookUser)
 {
     base.AddObject("FacebookUsers", facebookUser);
 }
예제 #4
0
 public FacebookComment(FacebookUser fbUser, FacebookPost fbPost)
 {
     FBuser = fbUser;
     FBPost = fbPost;
 }
 /// <summary>
 /// Create a new FacebookUser object.
 /// </summary>
 /// <param name="facebookId">Initial value of the facebookId property.</param>
 /// <param name="firstlogin">Initial value of the firstlogin property.</param>
 /// <param name="active">Initial value of the active property.</param>
 /// <param name="posts">Initial value of the posts property.</param>
 public static FacebookUser CreateFacebookUser(global::System.Int64 facebookId, global::System.DateTime firstlogin, global::System.Boolean active, global::System.Int32 posts)
 {
     FacebookUser facebookUser = new FacebookUser();
     facebookUser.facebookId = facebookId;
     facebookUser.firstlogin = firstlogin;
     facebookUser.active = active;
     facebookUser.posts = posts;
     return facebookUser;
 }