Return JSON from WebAPI

In WebAPI, you may want to return JSON instead of the out of the box view, which looks like below: The out of the box code for the controller looks like as follows: To display JSON, change View to Json: In running this, you may get the error: “This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a … Continue reading Return JSON from WebAPI

Using Fiddler with Web API

In this post, we will examine using Fiddler to send requests and receive responses from an ASP.NET Web API. I have a Web API sample that looks like the following: There are different HTTP verbs, including: GET PUT POST DELETE The Customers API is very simple – it integrates with a SQL Server table called Customers with 2 fields – CustomerId and CustomerName, with the data: Start Fiddler. We will … Continue reading Using Fiddler with Web API

Update Entity Framework Model

When using Entity Framework, you may need to update the model, if for example you want to add or remove objects such as fields, or you want to refresh the current model. To do this, select the edmx file, and then right click on the designer and select Update Model from Database: From here you will be able to add/remove objects: