<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>API Help Page Description &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/api-help-page-description/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 02 Jun 2021 15:14:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>API Help Page Description &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Working with API help page controller action description in Web API</title>
		<link>https://sibeeshpassion.com/working-with-api-help-page-controller-action-description-in-web-api/</link>
					<comments>https://sibeeshpassion.com/working-with-api-help-page-controller-action-description-in-web-api/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 12 May 2016 00:00:24 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[API Help Page Description]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[Asp.Net]]></category>
		<category><![CDATA[Enable Region Summary Of Actions]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11555</guid>

					<description><![CDATA[In this article we are going to see how we can enable the API descriptions for the better understanding of how our API controller works and what exactly it is supposed to do. It is recommended that to give the summary and parameter lists and a bit introduction to the service whenever you write any API services. Here I am going to use create a Web API in Visual Studio 2015. I hope you will like this. Download the source code You can always download the source code here: API Help Page Documentation Background Few months back I have hosted [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this article we are going to see how we can enable the API descriptions for the better understanding of how our API controller works and what exactly it is supposed to do. It is recommended that to give the summary and parameter lists and a bit introduction to the service whenever you write any API services. Here I am going to use create a <a href="http://sibeeshpassion.com/category/web-api" target="_blank" rel="noopener">Web API</a> in <a href="http://sibeeshpassion.com/category/tools/visual-studio/" target="_blank" rel="noopener">Visual Studio</a> 2015. I hope you will like this.</p>
<p><strong>Download the source code</strong></p>
<p>You can always download the source code here: <a href="https://code.msdn.microsoft.com/Working-with-API-help-page-23eddf9e" target="_blank" rel="noopener">API Help Page Documentation</a></p>
<p><strong>Background</strong></p>
<p>Few months back I have hosted one of my API application to <a href="http://sibeeshpassion.com/category/azure" target="_blank" rel="noopener">Azure</a>. I thought of implementing the document summary for the services(controllers actions) now. And I did, now any one can understand what exactly my service will do by going to the help page of the API application. I will show you a demo of the same. Here we will create a Web API with entity framework. Lets us start then.</p>
<p><strong>Setting up database</strong></p>
<p>Here I am going to create a database which I created for my demo purposes, you can always create this database by running the queries mentioned here.</p>
<p><strong>Create database</strong></p>
<p>[sql]<br />
USE [master]<br />
GO</p>
<p>/****** Object:  Database [TrialsDB]    Script Date: 5/12/2016 10:56:41 AM ******/<br />
CREATE DATABASE [TrialsDB]<br />
 CONTAINMENT = NONE<br />
 ON  PRIMARY<br />
( NAME = N&#8217;TrialsDB&#8217;, FILENAME = N&#8217;C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TrialsDB.mdf&#8217; , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )<br />
 LOG ON<br />
( NAME = N&#8217;TrialsDB_log&#8217;, FILENAME = N&#8217;C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TrialsDB_log.ldf&#8217; , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET COMPATIBILITY_LEVEL = 110<br />
GO</p>
<p>IF (1 = FULLTEXTSERVICEPROPERTY(&#8216;IsFullTextInstalled&#8217;))<br />
begin<br />
EXEC [TrialsDB].[dbo].[sp_fulltext_database] @action = &#8216;enable&#8217;<br />
end<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_NULL_DEFAULT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_NULLS OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_PADDING OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_WARNINGS OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ARITHABORT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_CLOSE OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_CREATE_STATISTICS ON<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_SHRINK OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_UPDATE_STATISTICS ON<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET CURSOR_CLOSE_ON_COMMIT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET CURSOR_DEFAULT  GLOBAL<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET CONCAT_NULL_YIELDS_NULL OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET NUMERIC_ROUNDABORT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET QUOTED_IDENTIFIER OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET RECURSIVE_TRIGGERS OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET  DISABLE_BROKER<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_UPDATE_STATISTICS_ASYNC OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET DATE_CORRELATION_OPTIMIZATION OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET TRUSTWORTHY OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ALLOW_SNAPSHOT_ISOLATION OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET PARAMETERIZATION SIMPLE<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET READ_COMMITTED_SNAPSHOT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET HONOR_BROKER_PRIORITY OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET RECOVERY FULL<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET  MULTI_USER<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET PAGE_VERIFY CHECKSUM<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET DB_CHAINING OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET TARGET_RECOVERY_TIME = 0 SECONDS<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET  READ_WRITE<br />
GO<br />
[/sql]</p>
<p><strong>Create table with data</strong></p>
<p>[sql]<br />
USE [TrialsDB]<br />
GO<br />
/****** Object:  Table [dbo].[Product]    Script Date: 5/12/2016 10:54:48 AM ******/<br />
SET ANSI_NULLS ON<br />
GO<br />
SET QUOTED_IDENTIFIER ON<br />
GO<br />
CREATE TABLE [dbo].[Product](<br />
	[ProductID] [int] NOT NULL,<br />
	[Name] [nvarchar](max) NOT NULL,<br />
	[ProductNumber] [nvarchar](25) NOT NULL,<br />
	[MakeFlag] [bit] NOT NULL,<br />
	[FinishedGoodsFlag] [bit] NOT NULL,<br />
	[Color] [nvarchar](15) NULL,<br />
	[SafetyStockLevel] [smallint] NOT NULL,<br />
	[ReorderPoint] [smallint] NOT NULL,<br />
	[StandardCost] [money] NOT NULL,<br />
	[ListPrice] [money] NOT NULL,<br />
	[Size] [nvarchar](5) NULL,<br />
	[SizeUnitMeasureCode] [nchar](3) NULL,<br />
	[WeightUnitMeasureCode] [nchar](3) NULL,<br />
	[Weight] [decimal](8, 2) NULL,<br />
	[DaysToManufacture] [int] NOT NULL,<br />
	[ProductLine] [nchar](2) NULL,<br />
	[Class] [nchar](2) NULL,<br />
	[Style] [nchar](2) NULL,<br />
	[ProductSubcategoryID] [int] NULL,<br />
	[ProductModelID] [int] NULL,<br />
	[SellStartDate] [datetime] NOT NULL,<br />
	[SellEndDate] [datetime] NULL,<br />
	[DiscontinuedDate] [datetime] NULL,<br />
	[rowguid] [uniqueidentifier] ROWGUIDCOL  NOT NULL,<br />
	[ModifiedDate] [datetime] NOT NULL<br />
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]<br />
GO<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (1, N&#8217;Adjustable Race&#8217;, N&#8217;AR-5381&#8242;, 0, 0, NULL, 1000, 750, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;694215b7-08f7-4c0d-acb1-d734ba44c0c8&#8242;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (2, N&#8217;Bearing Ball&#8217;, N&#8217;BA-8327&#8242;, 0, 0, NULL, 1000, 750, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;58ae3c20-4f3a-4749-a7d4-d568806cc537&#8242;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (3, N&#8217;BB Ball Bearing&#8217;, N&#8217;BE-2349&#8242;, 1, 0, NULL, 800, 600, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;9c21aed2-5bfa-4f18-bcb8-f11638dc2e4e&#8217;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (4, N&#8217;Headset Ball Bearings&#8217;, N&#8217;BE-2908&#8242;, 0, 0, NULL, 800, 600, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;ecfed6cb-51ff-49b5-b06c-7d8ac834db8b&#8217;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (316, N&#8217;Blade&#8217;, N&#8217;BL-2036&#8242;, 1, 0, NULL, 800, 600, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;e73e9750-603b-4131-89f5-3dd15ed5ff80&#8242;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (317, N&#8217;LL Crankarm&#8217;, N&#8217;CA-5965&#8242;, 0, 0, N&#8217;Black&#8217;, 500, 375, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, N&#8217;L &#8216;, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;3c9d10b7-a6b2-4774-9963-c19dcee72fea&#8217;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (318, N&#8217;ML Crankarm&#8217;, N&#8217;CA-6738&#8242;, 0, 0, N&#8217;Black&#8217;, 500, 375, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, N&#8217;M &#8216;, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;eabb9a92-fa07-4eab-8955-f0517b4a4ca7&#8217;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
[/sql]</p>
<p>Our database is ready, now create a Web API application in visual studio and then entity with the above mentioned database. </p>
<div id="attachment_11556" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/Creating-Entity-e1463031313825.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-11556" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/Creating-Entity-1024x542.png" alt="Creating Entity" width="634" height="336" class="size-large wp-image-11556" /></a><p id="caption-attachment-11556" class="wp-caption-text">Creating Entity</p></div>
<p>If you don&#8217;t know how to create an entity in your solution, please read that <a href="http://sibeeshpassion.com/web-api-with-angular-js/" target="_blank" rel="noopener">here</a>. I have mentioned the steps to be followed in that article. Once you have created the entity, you are good to go and create a API controller with the entity created. If you do so, The CRUD actions will be created automatically for you. You may need to edit those actions according to your needs. </p>
<div id="attachment_11557" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/Web-API-2-Controller-with-actions-using-Entity-Framework-e1463031653319.png"><img decoding="async" aria-describedby="caption-attachment-11557" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/Web-API-2-Controller-with-actions-using-Entity-Framework-e1463031653319.png" alt="Web API 2 Controller with actions, using Entity Framework" width="650" height="457" class="size-full wp-image-11557" srcset="/wp-content/uploads/2016/05/Web-API-2-Controller-with-actions-using-Entity-Framework-e1463031653319.png 650w, /wp-content/uploads/2016/05/Web-API-2-Controller-with-actions-using-Entity-Framework-e1463031653319-300x211.png 300w, /wp-content/uploads/2016/05/Web-API-2-Controller-with-actions-using-Entity-Framework-e1463031653319-400x281.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11557" class="wp-caption-text">Web API 2 Controller with actions, using Entity Framework</p></div>
<p>Select the Model Class, DBContext then name your controller and click OK. I hope a controller with the CRUD actions like preceding has been generated for you.</p>
<p>[csharp]<br />
 public class ProductsController : ApiController<br />
    {<br />
        private TrialsDBEntities db = new TrialsDBEntities();</p>
<p>        // GET: api/Products<br />
        public IQueryable&lt;Product&gt; GetProducts()<br />
        {<br />
            return db.Products;<br />
        }</p>
<p>        // GET: api/Products/5<br />
        [ResponseType(typeof(Product))]<br />
        public IHttpActionResult GetProduct(int id)<br />
        {<br />
            Product product = db.Products.Find(id);<br />
            if (product == null)<br />
            {<br />
                return NotFound();<br />
            }</p>
<p>            return Ok(product);<br />
        }</p>
<p>        // PUT: api/Products/5<br />
        [ResponseType(typeof(void))]<br />
        public IHttpActionResult PutProduct(int id, Product product)<br />
        {<br />
            if (!ModelState.IsValid)<br />
            {<br />
                return BadRequest(ModelState);<br />
            }</p>
<p>            if (id != product.ProductID)<br />
            {<br />
                return BadRequest();<br />
            }</p>
<p>            db.Entry(product).State = EntityState.Modified;</p>
<p>            try<br />
            {<br />
                db.SaveChanges();<br />
            }<br />
            catch (DbUpdateConcurrencyException)<br />
            {<br />
                if (!ProductExists(id))<br />
                {<br />
                    return NotFound();<br />
                }<br />
                else<br />
                {<br />
                    throw;<br />
                }<br />
            }</p>
<p>            return StatusCode(HttpStatusCode.NoContent);<br />
        }</p>
<p>        // POST: api/Products<br />
        [ResponseType(typeof(Product))]<br />
        public IHttpActionResult PostProduct(Product product)<br />
        {<br />
            if (!ModelState.IsValid)<br />
            {<br />
                return BadRequest(ModelState);<br />
            }</p>
<p>            db.Products.Add(product);</p>
<p>            try<br />
            {<br />
                db.SaveChanges();<br />
            }<br />
            catch (DbUpdateException)<br />
            {<br />
                if (ProductExists(product.ProductID))<br />
                {<br />
                    return Conflict();<br />
                }<br />
                else<br />
                {<br />
                    throw;<br />
                }<br />
            }</p>
<p>            return CreatedAtRoute(&quot;DefaultApi&quot;, new { id = product.ProductID }, product);<br />
        }</p>
<p>        // DELETE: api/Products/5<br />
        [ResponseType(typeof(Product))]<br />
        public IHttpActionResult DeleteProduct(int id)<br />
        {<br />
            Product product = db.Products.Find(id);<br />
            if (product == null)<br />
            {<br />
                return NotFound();<br />
            }</p>
<p>            db.Products.Remove(product);<br />
            db.SaveChanges();</p>
<p>            return Ok(product);<br />
        }</p>
<p>        protected override void Dispose(bool disposing)<br />
        {<br />
            if (disposing)<br />
            {<br />
                db.Dispose();<br />
            }<br />
            base.Dispose(disposing);<br />
        }</p>
<p>        private bool ProductExists(int id)<br />
        {<br />
            return db.Products.Count(e =&gt; e.ProductID == id) &gt; 0;<br />
        }<br />
    }<br />
[/csharp]</p>
<p>Now please run your application and go to the help page. You can see the API help page as follows. </p>
<div id="attachment_11558" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/API-Help-Page-e1463032044742.png"><img decoding="async" aria-describedby="caption-attachment-11558" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/API-Help-Page-e1463032044742.png" alt="API Help Page" width="650" height="524" class="size-full wp-image-11558" srcset="/wp-content/uploads/2016/05/API-Help-Page-e1463032044742.png 650w, /wp-content/uploads/2016/05/API-Help-Page-e1463032044742-300x242.png 300w, /wp-content/uploads/2016/05/API-Help-Page-e1463032044742-400x322.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11558" class="wp-caption-text">API Help Page</p></div>
<p>As you can see &#8216;No documentation available.&#8217; under description of all the service actions. No worries we will try to add some summary to the actions now. So we will change the code as follows.</p>
<p>[csharp]<br />
 #region GetProducts<br />
        /// &lt;summary&gt;<br />
        /// Get all the products available<br />
        /// GET: api/Products<br />
        /// &lt;/summary&gt;<br />
        public IQueryable&lt;Product&gt; GetProducts()<br />
        {<br />
            return db.Products;<br />
        }<br />
        #endregion</p>
<p>        #region GetProductWithParameter<br />
        /// &lt;summary&gt;<br />
        /// Get a single product<br />
        /// GET: api/Products/5<br />
        /// &lt;param name=&quot;id&quot;&gt;&lt;/param&gt;<br />
        /// &lt;/summary&gt;<br />
        [ResponseType(typeof(Product))]<br />
        public IHttpActionResult GetProduct(int id)<br />
        {<br />
            Product product = db.Products.Find(id);<br />
            if (product == null)<br />
            {<br />
                return NotFound();<br />
            }</p>
<p>            return Ok(product);<br />
        }<br />
        #endregion<br />
[/csharp]</p>
<p>Now run your application and see the help page. Still the same result? Hmm, here comes the things we need to do. I will explain that. </p>
<li>Go to Areas\HelpPage\App_Start and click on the file <em>HelpPageConfig.cs</em>.</li>
<li>Uncomment the following line from the static function Register. </li>
<p>[csharp]<br />
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath(&quot;App_Data/XmlDocument.xml&quot;)));<br />
[/csharp]</p>
<li>Right click on your project and go to properties, then click on Build</li>
<li>Go to Output section and click on XML documentation file and then type <em>~/App_Data/XmlDocument.xml</em> in the given text box. </li>
<li>Save and build your project.</li>
<p>This will create a XML document with the name <em>XmlDocument.xml</em> in App_Data folder. Once it is generated, the summary you have described in your API controller will be listed there. Initially the file will be in excluded state, you may need to include the same to your project when you deploy your API application. For that please follows the below steps. </p>
<li>Click on show all files.</li>
<li>Click on Refresh.</li>
<li>Go to App_Data folder and find XmlDocument.xml.</li>
<li>Right click the file and click Include In Project.</li>
<p>That&#8217;s all. Run your application and see the Help page again. Hope you get the page as follows. </p>
<div id="attachment_11559" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/API-Help-Page-With-Descriptions-e1463033550891.png"><img decoding="async" aria-describedby="caption-attachment-11559" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/API-Help-Page-With-Descriptions-e1463033550891.png" alt="API Help Page With Descriptions" width="650" height="361" class="size-full wp-image-11559" srcset="/wp-content/uploads/2016/05/API-Help-Page-With-Descriptions-e1463033550891.png 650w, /wp-content/uploads/2016/05/API-Help-Page-With-Descriptions-e1463033550891-300x167.png 300w, /wp-content/uploads/2016/05/API-Help-Page-With-Descriptions-e1463033550891-400x222.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11559" class="wp-caption-text">API Help Page With Descriptions</p></div>
<p>Have a happy coding!.</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn&#8217;t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/working-with-api-help-page-controller-action-description-in-web-api/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
