Reputation: 63
.Net API controller json content-type or parameter type mismatch problem.
{ "type": "https://tools.ietf.org/html/rfc7231#section-6.5.13", "title": "Unsupported Media Type", "status": 415, "traceId": "00-7afc8f3ea707214b897d04a298f7b3a6-fc9689395692c54f-00" }
Upvotes: 0
Views: 322
Reputation: 45
try this
using (var Context = new TContext()) // getting appropriate context generic
{
var result = Context.Orders.Add(entity); // I've assumed that DBSet for your order table is Orders
Context.SaveChanges();
}
Upvotes: 1