Skip to content

Commit

Permalink
Fix StyleCop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Dec 6, 2016
1 parent e862834 commit 0644524
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Source/StrongGrid/Model/Webhooks/InboundEmail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class InboundEmail
public string SpamScore { get; set; }

/// <summary>
/// Gets or sets the attachment.
/// Gets or sets the attachment.
/// </summary>
/// <value>
/// The attachment.
Expand Down
6 changes: 4 additions & 2 deletions Source/StrongGrid/Model/Webhooks/InboundEmailAttachment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

namespace StrongGrid.Model.Webhooks
{
/// <summary>
/// Strongly typed representation of the information sudmited by SendGrid in a 'inbound parse' webhook
/// </summary>
public class InboundEmailAttachment
{

/// <summary>
/// Gets or sets the identifier.
/// </summary>
Expand All @@ -23,7 +25,7 @@ public class InboundEmailAttachment
public string ContentType { get; set; }

/// <summary>
/// Gets the data.
/// Gets or sets the data.
/// </summary>
/// <value>
/// The data.
Expand Down
1 change: 0 additions & 1 deletion Source/StrongGrid/Model/Webhooks/InboundEmailEnvelope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class InboundEmailEnvelope

/// <summary>
/// Gets or sets from, which is the return path for the message.

/// </summary>
/// <value>
/// From.
Expand Down
16 changes: 8 additions & 8 deletions Source/StrongGrid/WebhookParser.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using HttpMultipartParser;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using StrongGrid.Model;
using StrongGrid.Model.Webhooks;
using StrongGrid.Utilities;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System.Linq;
using Newtonsoft.Json.Linq;
using System.Text;
using StrongGrid.Model;
using System.Threading.Tasks;

namespace StrongGrid
{
Expand Down Expand Up @@ -79,7 +79,7 @@ public InboundEmail ParseInboundEmailWebhook(Stream stream)

// Convert the 'headers' from a string into array of KeyValuePair
var rawHeaders = parser
.GetParameterValue("headers", "")
.GetParameterValue("headers", string.Empty)
.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
var headers = rawHeaders
.Select(header =>
Expand Down Expand Up @@ -122,14 +122,14 @@ public InboundEmail ParseInboundEmailWebhook(Stream stream)
var envelope = JsonConvert.DeserializeObject<InboundEmailEnvelope>(parser.GetParameterValue("envelope", "{}"));

// Convert the 'from' from a string into a strongly typed object
var rawFrom = parser.GetParameterValue("from", "");
var rawFrom = parser.GetParameterValue("from", string.Empty);
var piecesFrom = rawFrom.Split(new[] { '<', '>' }, StringSplitOptions.RemoveEmptyEntries);
var from = new MailAddress(piecesFrom[1], piecesFrom[0].Replace("\"", "").Trim());
var from = new MailAddress(piecesFrom[1], piecesFrom[0].Replace("\"", string.Empty).Trim());

// Convert the 'to' from a string into a strongly typed object
var rawTo = parser.GetParameterValue("to", "");
var rawTo = parser.GetParameterValue("to", string.Empty);
var piecesTo = rawFrom.Split(new[] { '<', '>' }, StringSplitOptions.RemoveEmptyEntries);
var to = new MailAddress(piecesFrom[1], piecesFrom[0].Replace("\"", "").Trim());
var to = new MailAddress(piecesFrom[1], piecesFrom[0].Replace("\"", string.Empty).Trim());

// Arrange the InboundEmail
var inboundEmail = new InboundEmail
Expand Down

0 comments on commit 0644524

Please sign in to comment.