diff --git a/src/OutgoingWebhook/Controllers/MessagesController.cs b/src/OutgoingWebhook/Controllers/MessagesController.cs index 5d6edb0..17fc1a4 100644 --- a/src/OutgoingWebhook/Controllers/MessagesController.cs +++ b/src/OutgoingWebhook/Controllers/MessagesController.cs @@ -23,7 +23,7 @@ public Activity GetMessage([FromBody]Activity activity) var authResult = _teamsAuth.Validate(this.Request); if (!authResult.AuthSuccessful) { - return new Activity() + return new Activity { Text = "You are not authorized to call into this endpoint." }; @@ -33,7 +33,7 @@ public Activity GetMessage([FromBody]Activity activity) if (activity.Text.Contains("hero", StringComparison.InvariantCultureIgnoreCase)) { var card = CreateSampleHeroCard(); - attachment = new Attachment() + attachment = new Attachment { ContentType = HeroCard.ContentType, Content = card @@ -42,7 +42,7 @@ public Activity GetMessage([FromBody]Activity activity) else if (activity.Text.Contains("thumbnail", StringComparison.InvariantCultureIgnoreCase)) { var card = CreateSampleThumbnailCard(); - attachment = new Attachment() + attachment = new Attachment { ContentType = ThumbnailCard.ContentType, Content = card @@ -51,13 +51,13 @@ public Activity GetMessage([FromBody]Activity activity) if (attachment != null) { - return new Activity() + return new Activity { Attachments = new List() { attachment } }; } - return new Activity() + return new Activity { Text = "Try to type hero or thumbnail." }; @@ -65,21 +65,21 @@ public Activity GetMessage([FromBody]Activity activity) private HeroCard CreateSampleHeroCard() { - return new HeroCard() + return new HeroCard { Title = "Superhero", Subtitle = "An incredible hero", Text = "Microsoft Teams", - Images = new List() + Images = new List { - new CardImage() + new CardImage { Url = "https://github.com/tony-xia/microsoft-teams-templates/raw/master/images/cbd_after_sunset.jpg" } }, - Buttons = new List() + Buttons = new List { - new CardAction() + new CardAction { Type = "openUrl", Title = "Visit", @@ -91,20 +91,20 @@ private HeroCard CreateSampleHeroCard() private ThumbnailCard CreateSampleThumbnailCard() { - return new ThumbnailCard() + return new ThumbnailCard { Title = "Teams Sample", Subtitle = "Outgoing Webhook sample", - Images = new List() + Images = new List { - new CardImage() + new CardImage { Url = "https://github.com/tony-xia/microsoft-teams-templates/raw/master/images/steak.jpg" } }, - Buttons = new List() + Buttons = new List { - new CardAction() + new CardAction { Type = "openUrl", Title = "Visit",