You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
You should be able to annotate your property with [ModelBinder(Name = "smtp-id")] if you're dealing with model bound objects. That said, it looks like SendGrid uses Json payloads - https://sendgrid.com/docs/API_Reference/Event_Webhook/event.html#-Events - at which point, annotating it with JsonProperty would be right thing since the model would get deserialized by Json.NET
Thanks for contacting us. We believe that the question you've raised have been answered. If you still feel a need to continue the discussion, feel free to reopen it and add your comments.
Is this a Bug or Feature request?:
Feature
Steps to reproduce (preferrably a link to a GitHub repo with a repro project):
Try to bind to "smtp-id" in a web api call. It cannot be done, as the dash is not allowed in a property name.
Description of the problem:
But there is no way to put an attribute on the Input Model to tell the ModelBinder to bind to "SmtpId"
public class InputModel{
[JsonProperty("smpt-id")]//It would be great if this would work.
public string SmtpId{get;set;}
}
I encountered this issue trying to process SendGrid event hooks. They use the dash and I cannot get them to change it.
Version of
Microsoft.AspNetCore.Mvc
orMicrosoft.AspNetCore.App
orMicrosoft.AspNetCore.All
: 2.02The text was updated successfully, but these errors were encountered: