Exemplo n.º 1
0
        public Followee Create(FolloweeFromApiDto followee)
        {
            if (followee == null)
            {
                throw new ArgumentNullException("Followee cannot be null!");
            }

            Followee followeeToAdd = new Followee
            {
                FolloweeId = followee.FolloweeId,
                Bio        = followee.Bio,
                ScreenName = followee.ScreenName,
                Name       = followee.Name,
                FolloweeOriginallyCreatedOn = dateTimeParser.ParseFromTwitter(followee.FolloweeOriginallyCreatedOn),
                Url            = followee.Url,
                FavoritesCount = followee.FavoritesCount,
                FollowersCount = followee.FollowersCount,
                FriendsCount   = followee.FriendsCount,
                StatusesCount  = followee.StatusesCount
            };

            this.unitOfWork.Followees.Add(followeeToAdd);
            this.unitOfWork.SaveChanges();
            return(followeeToAdd);
        }