How to Create a Web API App using ASP.NET Core with App Insights

In this post, we will look at how to create an ASP.NET Core Web Application and host it in Azure with Application Insights. First, let’s open Visual Studio and create a new ASP.NET Core Web Application project: Give the project a name: And select API as the type: We see the project in VS below: Press F5 to run the app. Click Yes if you see the message below: And click … Continue reading How to Create a Web API App using ASP.NET Core with App Insights

How to Install Postman for Windows

The Postman Chrome extension is being deprecated and replaced with Postman for Windows. To install it, head over to https://www.getpostman.com/downloads/ and click Download: We will download the Windows 64-bit app. Click to open the exe: From here, the Windows app will install and open:  

HttpClient GetAsync, PostAsync, SendAsync in C#

HttpClient is a library in the Microsoft .NET framework 4+ that is used for GET and POST requests. Let’s go through a simple example of using HttpClient to GET and POST JSON from a web application. First, we will create our client application. We will create a new console app in Visual Studio: Add the System.Net.Http namespace. We will pull down JSON data from a REST service: Now, to read this, we … Continue reading HttpClient GetAsync, PostAsync, SendAsync in C#

Creating a WCF REST Service with Entity Framework

In this post, we will go through how to use WCF to create a REST service, also using the Entity Framework to connect to a database. We have a SQL database that holds customer information. We would like to expose this as through a REST service. In the database, we have a table called Customers that we will build our service for: Open Visual Studio and create a new WCF Service … Continue reading Creating a WCF REST Service with Entity Framework

Using Browser Network Trace with Fiddler

When analyzing and troubleshooting network traces in browsers such as Edge, Chome, Firefox, and IE, you can export these and import them into Fiddler for further analysis. For example, let’s say you are working in Edge and are analyzing a REST API. You send a request through your browser to the API, that returns a list of customers: If you click F12 to open Developer Tools, you can see the request … Continue reading Using Browser Network Trace with Fiddler

OData Connected Service in Visual Studio 2017

Here we will use the OData Connected Service to connect to an OData feed from Visual Studio 2017. First, install the extension. Select Tools->Extensions and Updates: Select Online and search for OData Connected Service: Restart Visual Studio to complete the install. Create a new Visual Studio console app: Right Click and select Add->Connected Service: Select OData Connected Service: We will connect to:  https://services.odata.org/V4/Northwind/Northwind.svc/. The service looks like: Enter the service … Continue reading OData Connected Service in Visual Studio 2017

OData Client Code Generator

The OData v4 Client Code Generator is an extension that can be used to generate OData code for use in applications. To install it, open Visual Studio 2015 and under Visual Studio Gallery, search for OData Client Code Generator: Click to Install: The extension is now installed: To use the extension, we will create a new Windows Console project: Add a new item and under Code select OData Client: Files … Continue reading OData Client Code Generator

Create a WCF Windows Service

Here we will create a WCF web service hosted as a windows service. We will go through step by step how to do this. First, create a new WCF Service Application: This will create the project: If we select the Service1.svc page and press F5 to run this, it will open the WCF Test Client. From here, we can select the GetData() method and enter a value. Invoking the method will … Continue reading Create a WCF Windows Service