Skip to content

Commit

Permalink
Simplify JObject creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Nov 28, 2020
1 parent 4e7884f commit 4b6f834
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/StrongGrid/Resources/WebhookSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ public Task DeleteInboundParseWebhookSettingsAsync(string hostname, string onBeh

private static JObject CreateJObject(string hostname, Parameter<string> url, Parameter<bool> spamCheck, Parameter<bool> sendRaw)
{
var result = new JObject();
result.Add("hostname", hostname);
var result = new JObject
{
{ "hostname", hostname }
};
result.AddPropertyIfValue("url", url);
result.AddPropertyIfValue("spam_check", spamCheck);
result.AddPropertyIfValue("send_raw", sendRaw);
Expand Down

0 comments on commit 4b6f834

Please sign in to comment.