NoStuff
NoStuff

Reputation: 63

Api controller does not work because of unsupported media type

.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

Answers (1)

Mohammed Alzamil
Mohammed Alzamil

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

Related Questions