Exemplo n.º 1
0
        public PartialViewResult Tweet(HomeViewModel model)
        {
            Tweet tweet = new Tweet()
            {
                BelongsTo = _twitterService.GetFeed(Convert.ToInt64(model.SelectedFeed)),
                Content = model.Tweet,
                PostDate = DateTime.Now
            };
            _twitterService.AddTweet(tweet);
            _unit.Commit();

            HomeViewModel updatedMode = GenerateIndexModel(model.DisplayFeed);
            updatedMode.Tweet = "";
            updatedMode.SelectedFeed = model.SelectedFeed;
            ModelState.Clear();
            return PartialView("_TweetView", updatedMode);
        }
Exemplo n.º 2
0
 public void AddTweet(Twitter_Shared.Data.Model.Tweet tweet)
 {
     _tweetRepository.Insert(tweet);
 }