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(); }
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(); }