by Yogesh | Feb 25, 2018 | Asp .net MVC, WebApi Tutorial
Install Microsoft.AspNet.WebApi.Cors using nuget package manager console Make Changes at webapi.config var enableCorsAttribute = new EnableCorsAttribute(“*”, “*”, “*”); config.EnableCors(enableCorsAttribute); Create web api 2...
by Yogesh | Aug 2, 2017 | WebApi Tutorial
How many ways of Exception Handling 1.HttpResponseException 2.HttpError 3.Exception Filters 1. HttpResponseException Class: This exception returns any HTTP status code that you specify in the exception constructor. ▸2. Http Error: ▸CreateErrorResponse method of...
by Yogesh | Jul 30, 2017 | WebApi Tutorial
Step 1: Create a empty MVC project with MVC and Web API checkbox selected. Step 2: Add WebAPI2 Controller in controller folder. Step4: Write Following Code in WEBAPI Controller. using System; using System.Collections.Generic; using System.IO; using System.Linq;...
by Yogesh | Jul 30, 2017 | WebApi Tutorial
Step 1: First create info table in database. Step 2: Add ADO.NET ENTITY DATA Model. Step 3. Create Web API controller with read write scaffolding option. Step 4: Now run and see output of API Controller(Employee) Step 5: Add a action in previously created home...
by Yogesh | Jul 12, 2016 | WebApi Tutorial
Introduction of REST Services We can define Representational State Transfer (REST) as an architectural style that sits on top of a series of principles. ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients,...
by Yogesh | Jun 7, 2016 | Asp .net MVC, WebApi Tutorial
Step1 : Create New Project Go to File > New > Project > Select asp.net web application > Entry Application Name > Click OK >Select Empty Template > Check Web API CheckBox > > OK Some Snap Shots of above procedure are given below. Step2 : Add Database Table (Here...