Ejemplo n.º 1
0
        public static Tweet ConvertToDB(TweetModel tweet)
        {
            var newTweet = new Tweet
            {
                User = new User(),
                User_Id = tweet.User_Id,
                Body = tweet.Body,
                Date_time = DateTime.Now
            };

            return newTweet;
        }
Ejemplo n.º 2
0
        public static TweetViewModel ConvertToViewModel(Tweet tweet)
        {
            var newTweet = new TweetViewModel
            {
                Id = tweet.Id,
                User_Id = tweet.User_Id,
                Body = tweet.Body,
                DateAdded = tweet.Date_time,
                AuthorId = tweet.User_Id
            };

            return newTweet;
        }