Note that there are some explanatory texts on larger screens.

plurals
  1. POCorrect way to post dates to Web API?
    primarykey
    data
    text
    <p>I am reading data from Web API and populate a form. When I submit it back to Web API, I get this error:</p> <blockquote> <p>{"Message":"An error has occurred.","ExceptionMessage":"Property 'StartDate' on type 'MvcApplication1.Models.ProductSale' is invalid. Value-typed properties marked as [Required] must also be marked with [DataMember(IsRequired=true)] to be recognized as required. Consider attributing the declaring type with [DataContract] and the property with [DataMember(IsRequired=true)].","ExceptionType":"System.InvalidOperationException","StackTrace":" at System.Web.Http.Validation.Validators.ErrorModelValidator.Validate(ModelMetadata metadata, Object container)\r\n at System.Web.Http.Validation.DefaultBodyModelValidator.ShallowValidate(ModelMetadata metadata, ValidationContext validationContext, Object container)\r\n<br> at System.Web.Http.Validation.DefaultBodyModelValidator.ValidateProperties(ModelMetadata metadata, ValidationContext validationContext)\r\n at System.Web.Http.Validation.DefaultBodyModelValidator.ValidateNodeAndChildren(ModelMetadata metadata, ValidationContext validationContext, Object container)\r\n<br> at System.Web.Http.ModelBinding.FormatterParameterBinding.&lt;>c_<em>DisplayClass1.b</em>_0(Object model)\r\n at System.Threading.Tasks.TaskHelpersExtensions.&lt;>c_<em>DisplayClass49.b</em>_48()\r\n at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)"} 1</p> </blockquote> <p>My date comes Web API as "2013-01-31T16:27:18.503" and posts back as "2013-01-31T05:00:00.000Z". I can intercept the payload before sending to Web API and can use something like <a href="http://momentjs.com" rel="nofollow">http://momentjs.com</a> to parse it, but what should I do? This is driving me nuts!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload