Esempio n. 1
0
 public void UpdateTempUser(User user)
 {
     var temp = context.Temps.FirstOrDefault(t => t.Type == TempType.User);
     if (temp == null)
     {
         temp = new Temp { Type = TempType.User };
         context.Temps.InsertOnSubmit(temp);
     }
     temp.Data = JsonConvert.SerializeObject(user);
     context.SubmitChanges();
 }
Esempio n. 2
0
 public void UpdateTempTweet(Tweet tweet)
 {
     var temp = context.Temps.FirstOrDefault(t => t.Type == TempType.TweetDetail);
     if (temp == null)
     {
         temp = new Temp { Type = TempType.TweetDetail };
         context.Temps.InsertOnSubmit(temp);
     }
     temp.Data = JsonConvert.SerializeObject(tweet);
     context.SubmitChanges();
 }