public ActionResult CompanyShare(string ShareId, string CompanyId)
        {
            var item = new Sparkle.LinkedInNET.Common.PostShare
            {
                Visibility = new Visibility
                {
                    Code = "anyone",
                },
                Comment = "Testing a full company share with Sparkle.LinkedInNET in C#.NET!",
            };

            if (ShareId != null)
            {
                item.Attribution = new Attribution
                {
                    Share = ShareId,
                };
            }
            else
            {
                item.Content = new PostShareContent
                {
                    SubmittedUrl      = "https://github.com/SparkleNetworks/LinkedInNET",
                    Title             = "SparkleNetworks/LinkedInNET",
                    Description       = "Sparkle.LinkedInNET will help you query the LinkedIn API with C# :)",
                    SubmittedImageUrl = "https://raw.githubusercontent.com/SparkleNetworks/LinkedInNET/master/src/LiNET-200.png",
                };
            }

            this.ViewBag.Share = item;

            var model = new CompanyShareModel
            {
                CompanyId = 2414183,
                Json      = JsonConvert.SerializeObject(item, Formatting.Indented, shareSettings),
            };

            int id;

            if (!string.IsNullOrEmpty(CompanyId) && int.TryParse(CompanyId, out id))
            {
                model.CompanyId = id;
            }

            return(this.View(model));
        }
Пример #2
0
        public ActionResult UserShare(string ShareId)
        {
            // PERMISSION REQUIRED: rw_nus
            var item = new Sparkle.LinkedInNET.Common.PostShare
            {
                Visibility = new Visibility
                {
                    Code = "anyone",
                },
                Comment = "Testing a user share with Sparkle.LinkedInNET in C#.NET!",
            };

            if (ShareId != null)
            {
                item.Attribution = new Attribution
                {
                    Share = ShareId,
                };
            }
            else
            {
                item.Content = new PostShareContent
                {
                    SubmittedUrl      = "https://github.com/SparkleNetworks/LinkedInNET",
                    Title             = "SparkleNetworks/LinkedInNET",
                    Description       = "Sparkle.LinkedInNET will help you query the LinkedIn API with C# :)",
                    SubmittedImageUrl = "https://raw.githubusercontent.com/SparkleNetworks/LinkedInNET/master/src/LiNET-200.png",
                };
            }

            this.ViewBag.Share = item;

            var model = new CompanyShareModel
            {
                Json = JsonConvert.SerializeObject(item, Formatting.Indented, shareSettings),
            };

            return(this.View(model));
        }
Пример #3
0
        public ActionResult CompanyShare(string ShareId)
        {
            var item = new Sparkle.LinkedInNET.Common.PostShare
            {
                Visibility = new Visibility
                {
                    Code = "anyone",
                },
                Comment = "Testing a full company share with Sparkle.LinkedInNET in C#.NET!",
            };

            if (ShareId != null)
            {
                item.Attribution = new Attribution
                {
                    Share = ShareId,
                };
            }
            else
            {
                item.Content = new PostShareContent
                {
                    SubmittedUrl = "https://github.com/SparkleNetworks/LinkedInNET",
                    Title = "SparkleNetworks/LinkedInNET",
                    Description = "Sparkle.LinkedInNET will help you query the LinkedIn API with C# :)",
                    SubmittedImageUrl = "https://raw.githubusercontent.com/SparkleNetworks/LinkedInNET/master/src/LiNET-200.png",
                };
            }

            this.ViewBag.Share = item;

            var model = new CompanyShareModel
            {
                CompanyId = 2414183,
                Json = JsonConvert.SerializeObject(item, Formatting.Indented, shareSettings),
            };
            return this.View(model);
        }