Esempio n. 1
0
 internal void SaveTweet(PostTweetCommand command, Guid id)
 {
     TweetsContextFactory contextFactory = new TweetsContextFactory();
     AnonoMightEntities context = contextFactory.GetContext(command.SiteName);
     context.Tweets.Add(new Tweet { Id = id, Text = command.Text, TimeStamp = DateTime.Now, Reports = 0 });
     context.SaveChanges();
 }
Esempio n. 2
0
 public void PostTweet(PostTweetCommand command)
 {
     Guid id = Guid.NewGuid();
     _dataPersistor.SaveTweet(command, id);
     Clients.Group(command.SiteName).postTweetReceived(new PostedTweetEvent { Id=id, Text = command.Text, Timestamp = DateTime.Now });
 }