public GitHubActivity AddNewActivity(GitHubActivity activity)
        {
            var activityAdded = context.GitHubActivities.Add(activity);
            context.SaveChanges();

            return activityAdded;
        }
Exemplo n.º 2
0
        public GitHubActivity AddNewActivity(GitHubActivity activity)
        {
            var activityAdded = context.GitHubActivities.Add(activity);

            context.SaveChanges();

            return(activityAdded);
        }
Exemplo n.º 3
0
        public GitHubActivity ConvertToActivity()
        {
            var activity = new GitHubActivity();

            activity.ActivityType = ActivityType.ToString();
            if (ActivityType == GitHubActivityType.IssueClosed || ActivityType == GitHubActivityType.IssueOpened)
            {
                activity.Link        = Issue.GetValue("html_url").Value <string>();
                activity.Description = Issue.GetValue("title").Value <string>();
            }
            else if (ActivityType == GitHubActivityType.Commit)
            {
                activity.Link        = Commits[0].GetValue("url").Value <string>();
                activity.Description = Commits[0].GetValue("message").Value <string>();
            }
            else
            {
                activity.Link        = Comment.GetValue("html_url").Value <string>();
                activity.Description = Comment.GetValue("body").Value <string>();
            }

            return(activity);
        }
Exemplo n.º 4
0
        public GitHubActivity ConvertToActivity()
        {
            var activity = new GitHubActivity();

            activity.ActivityType = ActivityType.ToString();
            if (ActivityType == GitHubActivityType.IssueClosed || ActivityType == GitHubActivityType.IssueOpened)
            {
                activity.Link = Issue.GetValue("html_url").Value<string>();
                activity.Description = Issue.GetValue("title").Value<string>();
            }
            else if (ActivityType == GitHubActivityType.Commit)
            {
                activity.Link = Commits[0].GetValue("url").Value<string>();
                activity.Description = Commits[0].GetValue("message").Value<string>();
            }
            else
            {
                activity.Link = Comment.GetValue("html_url").Value<string>();
                activity.Description = Comment.GetValue("body").Value<string>();
            }

            return activity;
        }