Beispiel #1
0
 public TweetExtended(Twitterizer.TwitterStatus st)
 {
     using (var db = new dbContainer()) {
         try {
             Local = db.TweetSet.First(t => t.TweetId == st.Id);
         } catch (InvalidOperationException) {
             Local = new Twitruc.DAL.Tweet();
             Local.Content = st.Text;
             Local.AuthorNick = st.User.ScreenName;
             Local.Date = st.CreatedDate;
             Local.TweetId = st.Id;
             Local.TwitrucUser = null;
             Local.Public = !st.User.IsProtected;
             db.TweetSet.AddObject(Local);
             db.SaveChanges();
         }
         Tweeter = st;
         EndInit();
     }
 }
Beispiel #2
0
 public TweetExtended(Twitterizer.TwitterStatus st)
 {
     using (var db = new dbContainer()) {
         try {
             Local = db.TweetSet.First(t => t.TweetId == st.Id);
         } catch (InvalidOperationException) {
             Local             = new Twitruc.DAL.Tweet();
             Local.Content     = st.Text;
             Local.AuthorNick  = st.User.ScreenName;
             Local.Date        = st.CreatedDate;
             Local.TweetId     = st.Id;
             Local.TwitrucUser = null;
             Local.Public      = !st.User.IsProtected;
             db.TweetSet.AddObject(Local);
             db.SaveChanges();
         }
         Tweeter = st;
         EndInit();
     }
 }
Beispiel #3
0
 public TweetExtended(Tweet t)
 {
     Tweeter = null;
     Local = t;
     EndInit();
 }
Beispiel #4
0
 public Tweet CreateTweet(string content, TwUser u)
 {
     if (String.IsNullOrEmpty(content))
         throw new ArgumentException("Value cannot be null or empty.", "Content");
     var t = new Tweet();
     t.Content = content;
     t.TwitrucUser = u;
     t.AuthorNick = u.TwitterNick;
     t.Date = DateTime.Now;
     t.Sent = false;
     t.Public = false;
     db.TweetSet.AddObject(t);
     db.SaveChanges();
     return t;
 }
Beispiel #5
0
 /// <summary>
 /// Create a new Tweet object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="tweetId">Initial value of the TweetId property.</param>
 /// <param name="content">Initial value of the Content property.</param>
 /// <param name="date">Initial value of the Date property.</param>
 /// <param name="authorNick">Initial value of the AuthorNick property.</param>
 /// <param name="sent">Initial value of the Sent property.</param>
 /// <param name="public">Initial value of the Public property.</param>
 public static Tweet CreateTweet(global::System.Int64 id, global::System.Decimal tweetId, global::System.String content, global::System.DateTime date, global::System.String authorNick, global::System.Boolean sent, global::System.Boolean @public)
 {
     Tweet tweet = new Tweet();
     tweet.Id = id;
     tweet.TweetId = tweetId;
     tweet.Content = content;
     tweet.Date = date;
     tweet.AuthorNick = authorNick;
     tweet.Sent = sent;
     tweet.Public = @public;
     return tweet;
 }
Beispiel #6
0
 /// <summary>
 /// Deprecated Method for adding a new object to the TweetSet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTweetSet(Tweet tweet)
 {
     base.AddObject("TweetSet", tweet);
 }