<?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>Visual Studio &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/category/tools/visual-studio/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 02 Jun 2021 15:21:29 +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>Visual Studio &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Webinar: Why Visual Studio 2017? Few Features of VS2017 You May Love</title>
		<link>https://sibeeshpassion.com/webinar-why-visual-studio-2017-few-features-of-vs2017-you-may-love/</link>
					<comments>https://sibeeshpassion.com/webinar-why-visual-studio-2017-few-features-of-vs2017-you-may-love/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 10 Apr 2017 09:29:29 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2017]]></category>
		<category><![CDATA[Webinars]]></category>
		<category><![CDATA[Features of VS2017]]></category>
		<category><![CDATA[VS2017]]></category>
		<category><![CDATA[VS2017 IDE features]]></category>
		<category><![CDATA[Webinar]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12175</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/webinar-why-visual-studio-2017-few-features-of-vs2017-you-may-love/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The Cool New Refactoring and Text Editor Options in VS2017</title>
		<link>https://sibeeshpassion.com/the-cool-new-refactoring-and-text-editor-options-in-vs2017/</link>
					<comments>https://sibeeshpassion.com/the-cool-new-refactoring-and-text-editor-options-in-vs2017/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 02 Apr 2017 08:07:02 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2017]]></category>
		<category><![CDATA[New text editor experience in VS2017]]></category>
		<category><![CDATA[Refactoring In VS2017]]></category>
		<category><![CDATA[VS2017]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12167</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/the-cool-new-refactoring-and-text-editor-options-in-vs2017/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>What is there for a JavaScript developer in VS2017</title>
		<link>https://sibeeshpassion.com/what-is-there-for-a-javascript-developer-in-vs2017/</link>
					<comments>https://sibeeshpassion.com/what-is-there-for-a-javascript-developer-in-vs2017/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 02 Apr 2017 05:37:14 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2017]]></category>
		<category><![CDATA[Develop JavaScript application in VS2017]]></category>
		<category><![CDATA[JavaScript new features in VS2017]]></category>
		<category><![CDATA[VS2017]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12166</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/what-is-there-for-a-javascript-developer-in-vs2017/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>New Debugging Features In Visual Studio 2017</title>
		<link>https://sibeeshpassion.com/new-debugging-features-in-visual-studio-2017/</link>
					<comments>https://sibeeshpassion.com/new-debugging-features-in-visual-studio-2017/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 27 Mar 2017 15:10:52 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Visual Studio 2017]]></category>
		<category><![CDATA[New debugging features in VS2017]]></category>
		<category><![CDATA[Visual Studio Debugging Options]]></category>
		<category><![CDATA[VS2017]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12160</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/new-debugging-features-in-visual-studio-2017/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>VS2017 Start Page Changes</title>
		<link>https://sibeeshpassion.com/vs2017-start-page-changes/</link>
					<comments>https://sibeeshpassion.com/vs2017-start-page-changes/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sat, 25 Mar 2017 14:54:41 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Visual Studio 2017]]></category>
		<category><![CDATA[New in VS2017]]></category>
		<category><![CDATA[VS 2017 for developers]]></category>
		<category><![CDATA[VS2017]]></category>
		<category><![CDATA[VS2017 Start page]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12158</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/vs2017-start-page-changes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Modify or add project templates to VS2017</title>
		<link>https://sibeeshpassion.com/modify-or-add-project-templates-to-vs2017/</link>
					<comments>https://sibeeshpassion.com/modify-or-add-project-templates-to-vs2017/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 23 Mar 2017 17:16:26 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Visual Studio 2017]]></category>
		<category><![CDATA[Add Project Templates in VS2017]]></category>
		<category><![CDATA[Modify project templates in VS2017]]></category>
		<category><![CDATA[Updating components of VS2017]]></category>
		<category><![CDATA[Visual Studio Workloads]]></category>
		<category><![CDATA[VS2017]]></category>
		<category><![CDATA[VS2017 Installation]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12156</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/modify-or-add-project-templates-to-vs2017/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Why Visual Studio 2017? Let us try it &#8211; Part Two</title>
		<link>https://sibeeshpassion.com/why-visual-studio-2017-let-us-try-it-part-two/</link>
					<comments>https://sibeeshpassion.com/why-visual-studio-2017-let-us-try-it-part-two/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 14 Mar 2017 16:56:58 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2017]]></category>
		<category><![CDATA[Advantages of Visual Studio 2017]]></category>
		<category><![CDATA[All about Visual Studio 2017]]></category>
		<category><![CDATA[VS2017]]></category>
		<category><![CDATA[Why Visual Studio 2017]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12125</guid>

					<description><![CDATA[[toc] Introduction In this article we are going to see some features of the brand new Visual Studio 2017. This is the second article of the Visual Studio 2017 series. Please be noted that, this is not the complete series of new functionalities of Visual Studio 2017, here I am going to share only few things to get you started with the new Visual Studio 2017. I hope you will like this. Now let&#8217;s begin. Download Source Code VS2017 features you may love Background You can always find the first part of this series here. If you never use Visual [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>In this article we are going to see some features of the brand new <a href="http://sibeeshpassion.com/category/Visual-Studio/" target="_blank" rel="noopener">Visual Studio</a> 2017. This is the second article of the Visual Studio 2017 series. Please be noted that, this is not the complete series of new functionalities of Visual Studio 2017, here I am going to share only few things to get you started with the new Visual Studio 2017. I hope you will like this. Now let&#8217;s begin.</p>
<h3><strong>Download Source Code</strong></h3>
<ul>
<li><a href="https://code.msdn.microsoft.com/Why-Visual-Studio-2017-Let-24a4f7d9" target="_blank" rel="noopener">VS2017 features you may love</a></li>
</ul>
<h3><strong>Background</strong></h3>
<p>You can always find the first part of this series <a href="http://sibeeshpassion.com/why-visual-studio-2017-let-us-try-it/" target="_blank" rel="noopener">here</a>. If you never use Visual Studio, you can find some articles and code snippets relates to it <a href="http://sibeeshpassion.com/category/Visual-Studio/" target="_blank" rel="noopener">here</a></p>
<h3><strong>Let&#8217;s start then</strong></h3>
<p>Let&#8217;s say you have a MVC application with a model Customer as follows.</p>
<p>[csharp]<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Web;</p>
<p>namespace VS2017Features.Models<br />
{<br />
public class Customer<br />
{<br />
public string CustId { get; set; }<br />
public string CustName { get; set; }<br />
public string CustCode { get; set; }<br />
}<br />
}<br />
[/csharp]</p>
<p>And a controller as follows</p>
<p>[csharp]<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.Mvc;<br />
using VS2017Features.Models;<br />
namespace VS2017Features.Controllers<br />
{<br />
public class HomeController : Controller<br />
{<br />
// GET: Home<br />
public ActionResult Index()<br />
{<br />
List&lt;Customer&gt; lstCust = new List&lt;Customer&gt;();<br />
Customer cst = new Customer()<br />
{<br />
CustId = &#8220;1&#8221;,<br />
CustName = &#8220;Royal Enfield&#8221;,<br />
CustCode = &#8220;CST01&#8221;<br />
};<br />
lstCust.Add(cst);<br />
return View(lstCust);<br />
}<br />
}<br />
}<br />
[/csharp]</p>
<p>As of now, I am not going to explain the codes, as it is pretty much clear and easy. Now we are going to see the preceding topics.</p>
<ul>
<li>Run execution to here feature</li>
<li>The new exception handler</li>
<li>Redisigned Attach to process box</li>
<li>Reattach to process</li>
<li>What is there for JavaScript developer in VS2017</li>
</ul>
<h4><strong>Run execution to here feature</strong></h4>
<p>Let&#8217;s say we have a break point in our code as preceding.</p>
<div id="attachment_12126" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Run_execution_to_here_in_VS2017-e1489422491932.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-12126" class="size-full wp-image-12126" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Run_execution_to_here_in_VS2017-e1489422491932.png" alt="Run_execution_to_here_in_VS2017" width="634" height="304" srcset="/wp-content/uploads/2017/03/Run_execution_to_here_in_VS2017-e1489422491932.png 634w, /wp-content/uploads/2017/03/Run_execution_to_here_in_VS2017-e1489422491932-300x144.png 300w, /wp-content/uploads/2017/03/Run_execution_to_here_in_VS2017-e1489422491932-400x192.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12126" class="wp-caption-text">Run_execution_to_here_in_VS2017</p></div>
<p>Could you notice that there is a small green color icon in the image, in which you get the text &#8220;Run execution to here&#8221; while hovering it. This is a new feature in VS2017, if you click on the icon which is near to any lines of codes, the execution will hit at that point. That&#8217;s pretty much simple right? Now you don&#8217;t need to put any unwanted breakpoints for checking out the execution line by line while debugging.</p>
<p>Now what if you are using this feature in a loop. Let&#8217;s modify our controller code as preceding.</p>
<p>[csharp]<br />
public class HomeController : Controller<br />
{<br />
// GET: Home<br />
public ActionResult Index()<br />
{<br />
List&lt;Customer&gt; lstCust = BuildCustomer();<br />
return View(lstCust);<br />
}</p>
<p>private static List&lt;Customer&gt; BuildCustomer()<br />
{<br />
List&lt;Customer&gt; lstCust = new List&lt;Customer&gt;();<br />
for (int i = 0; i &lt; 5; i++)<br />
{<br />
Customer cst = new Customer()<br />
{<br />
CustId = i.ToString(),<br />
CustName = $&#8221;CustName{i}&#8221;,<br />
CustCode = $&#8221;CST{i}&#8221;<br />
};<br />
lstCust.Add(cst);<br />
}<br />
return lstCust;<br />
}<br />
}<br />
[/csharp]</p>
<p>And view as preceding.</p>
<p>[html]<br />
@model IEnumerable&lt;VS2017Features.Models.Customer&gt;</p>
<p>@{<br />
ViewBag.Title = &#8220;Index&#8221;;<br />
}</p>
<p>&lt;h2&gt;Index&lt;/h2&gt;<br />
&lt;style&gt;<br />
th, td, tr {<br />
border: 1px solid #ccc;<br />
padding: 10px;<br />
}<br />
&lt;/style&gt;<br />
&lt;table&gt;<br />
&lt;thead&gt;<br />
&lt;tr&gt;<br />
&lt;th&gt;Cust Id&lt;/th&gt;<br />
&lt;th&gt;Cust Name&lt;/th&gt;<br />
&lt;th&gt;Cust Code&lt;/th&gt;<br />
&lt;/tr&gt;<br />
&lt;/thead&gt;<br />
&lt;tbody&gt;<br />
@foreach (var item in Model)<br />
{</p>
<p>&lt;tr&gt;<br />
&lt;td&gt;@item.CustId&lt;/td&gt;<br />
&lt;td&gt;@item.CustName&lt;/td&gt;<br />
&lt;td&gt;@item.CustCode&lt;/td&gt;<br />
&lt;/tr&gt;</p>
<p>}<br />
&lt;/tbody&gt;<br />
&lt;/table&gt;<br />
[/html]</p>
<p>Now let&#8217;s run our application.</p>
<div id="attachment_12134" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Applciation_output-1-e1489505366729.png"><img decoding="async" aria-describedby="caption-attachment-12134" class="size-full wp-image-12134" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Applciation_output-1-e1489505366729.png" alt="Applciation_output" width="634" height="619" srcset="/wp-content/uploads/2017/03/Applciation_output-1-e1489505366729.png 366w, /wp-content/uploads/2017/03/Applciation_output-1-e1489505366729-300x293.png 300w, /wp-content/uploads/2017/03/Applciation_output-1-e1489505366729-400x391.png 400w, /wp-content/uploads/2017/03/Applciation_output-1-e1489505366729-615x600.png 615w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12134" class="wp-caption-text">Applciation_output</p></div>
<p>Put a breakpoint in the loop, when you run you can see that i value is getting incremented which means, the iterations are happening. Once the iterations are over, the execution comes out. Please be noted that you can always come out of this loop by changing the execution point.</p>
<div id="attachment_12127" style="width: 646px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Run_execution_to_here_in_loop_1.png"><img decoding="async" aria-describedby="caption-attachment-12127" class="size-full wp-image-12127" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Run_execution_to_here_in_loop_1.png" alt="Run_execution_to_here_in_loop_1" width="636" height="397" srcset="/wp-content/uploads/2017/03/Run_execution_to_here_in_loop_1.png 636w, /wp-content/uploads/2017/03/Run_execution_to_here_in_loop_1-300x187.png 300w, /wp-content/uploads/2017/03/Run_execution_to_here_in_loop_1-400x250.png 400w" sizes="(max-width: 636px) 100vw, 636px" /></a><p id="caption-attachment-12127" class="wp-caption-text">Run_execution_to_here_in_loop_1</p></div>
<div id="attachment_12128" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Run_execution_to_here_in_loop_2-e1489423535330.png"><img decoding="async" aria-describedby="caption-attachment-12128" class="size-full wp-image-12128" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Run_execution_to_here_in_loop_2-e1489423535330.png" alt="Run_execution_to_here_in_loop_2" width="634" height="370" srcset="/wp-content/uploads/2017/03/Run_execution_to_here_in_loop_2-e1489423535330.png 634w, /wp-content/uploads/2017/03/Run_execution_to_here_in_loop_2-e1489423535330-300x175.png 300w, /wp-content/uploads/2017/03/Run_execution_to_here_in_loop_2-e1489423535330-400x233.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12128" class="wp-caption-text">Run_execution_to_here_in_loop_2</p></div>
<h4><strong>The new exception popup</strong></h4>
<p>The new exception box is really handy which can be resized, as an additional features the inner exceptions are added to the pop up itself. No need to search for the inner exceptions now. To create an exception, we can call the preceding function.</p>
<p>[csharp]<br />
private void MakeDivideByZeroException()<br />
{<br />
throw new DivideByZeroException();<br />
}<br />
[/csharp]</p>
<p>Once you call the above function, you can get an error as follows.</p>
<div id="attachment_12129" style="width: 568px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/The_new_exception_box.png"><img decoding="async" aria-describedby="caption-attachment-12129" class="size-full wp-image-12129" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/The_new_exception_box.png" alt="The_new_exception_box" width="558" height="506" srcset="/wp-content/uploads/2017/03/The_new_exception_box.png 558w, /wp-content/uploads/2017/03/The_new_exception_box-300x272.png 300w, /wp-content/uploads/2017/03/The_new_exception_box-400x363.png 400w" sizes="(max-width: 558px) 100vw, 558px" /></a><p id="caption-attachment-12129" class="wp-caption-text">The_new_exception_box</p></div>
<p>If you click on the view details, a quick watch popup with the error information will be opened.</p>
<div id="attachment_12130" style="width: 494px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Quickwatch_in_VS2017.png"><img decoding="async" aria-describedby="caption-attachment-12130" class="size-full wp-image-12130" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Quickwatch_in_VS2017.png" alt="Quickwatch_in_VS2017" width="484" height="492" srcset="/wp-content/uploads/2017/03/Quickwatch_in_VS2017.png 484w, /wp-content/uploads/2017/03/Quickwatch_in_VS2017-295x300.png 295w, /wp-content/uploads/2017/03/Quickwatch_in_VS2017-400x407.png 400w" sizes="(max-width: 484px) 100vw, 484px" /></a><p id="caption-attachment-12130" class="wp-caption-text">Quickwatch_in_VS2017</p></div>
<p>Under the exception settings, you can always set whether you need to throw this type of exception only for the particular DLL or for every DLL.</p>
<h4><strong>Redesigned Attach to process box</strong></h4>
<p>We all know how we can attach to a process in Visual Studio. But have you ever thought, if we have a search box to search a process and attach to it, it would make the task easier? No worries, in VS2017 you get that. To see the redesigned Attach to process window, please click on Debug -&gt; Attach to process.</p>
<div id="attachment_12133" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Redesigned_attach_to_process-e1489504883213.png"><img decoding="async" aria-describedby="caption-attachment-12133" class="size-full wp-image-12133" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Redesigned_attach_to_process-e1489504883213.png" alt="Redesigned_attach_to_process" width="634" height="523" srcset="/wp-content/uploads/2017/03/Redesigned_attach_to_process-e1489504883213.png 433w, /wp-content/uploads/2017/03/Redesigned_attach_to_process-e1489504883213-300x247.png 300w, /wp-content/uploads/2017/03/Redesigned_attach_to_process-e1489504883213-400x330.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12133" class="wp-caption-text">Redesigned_attach_to_process</p></div>
<p>Now we have attached our process which was running in Microsoft Edge browser. Wait, the game is not over yet. Please click on the Debug option, you can see an option called Reattach to process. What is that? This option gives you an advantage of reattach the recent process that you already attached. That&#8217;s cool right? If you have one or more instance of the same process, it will ask you to select which ever you needed.</p>
<h3><strong>What is there for JavaScript developer in VS2017</strong></h3>
<p>VS2017 has lots of improvements for <a href="http://sibeeshpassion.com/category/JavaScript" target="_blank" rel="noopener">JavaScript</a> language. Let&#8217;s find out few of them.</p>
<ul>
<li>Advanced JavaScript intellisense</li>
<li>Added ECMAScript 6</li>
<li>Introduction of JS Doc</li>
<li>New Rename options in JavaScript</li>
<li>Find all references of functions or classes</li>
</ul>
<h4><strong>Advanced JavaScript intellisense</strong></h4>
<p>VS2017 has advanced intellisenses for JavaScript. We don&#8217;t need to remember the parameters for the in built functions of JavaScript. For example, if you typed <em>jQuery.ajax()</em> you can see the parameters of the functions as follows.</p>
<div id="attachment_12135" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Advanced_JavaScript_intellisence-e1489506433699.png"><img decoding="async" aria-describedby="caption-attachment-12135" class="size-full wp-image-12135" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Advanced_JavaScript_intellisence-e1489506433699.png" alt="Advanced_JavaScript_intellisence" width="634" height="217" srcset="/wp-content/uploads/2017/03/Advanced_JavaScript_intellisence-e1489506433699.png 634w, /wp-content/uploads/2017/03/Advanced_JavaScript_intellisence-e1489506433699-300x103.png 300w, /wp-content/uploads/2017/03/Advanced_JavaScript_intellisence-e1489506433699-400x137.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12135" class="wp-caption-text">Advanced_JavaScript_intellisence</p></div>
<p>The best thing is, it is even shows what exactly the type of the parameter. Yeah, JavaScript types are dynamic, so no one was creating a proper documentation for JavaScript functions. Now we have an option.</p>
<p>If you right click on the ajax() function and click on Go To Definition, you can see the definition in a .ts file (TypeScript) as follows.</p>
<p>[js]<br />
/**<br />
* Perform an asynchronous HTTP (Ajax) request.<br />
*<br />
* @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().<br />
* @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings}<br />
*/<br />
ajax(settings: JQueryAjaxSettings): JQueryXHR;<br />
/**<br />
* Perform an asynchronous HTTP (Ajax) request.<br />
*<br />
* @param url A string containing the URL to which the request is sent.<br />
* @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().<br />
* @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-url-settings}<br />
*/<br />
ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR;<br />
[/js]</p>
<p>In VS2017, all JavaScript related documentations are handled by these TypeScript files.</p>
<h4><strong>Added ECMAScript 6</strong></h4>
<p>In VS2017, the new ECMAScript 6 features are added which are more intuitive and OOP-style. So we can always use those in our application. Shall we start now?</p>
<p>[js]<br />
class Operations {<br />
constructor(x, y) {<br />
this.x = x;<br />
this.y = y;<br />
}<br />
add() {<br />
return (this.x + this.y);<br />
}<br />
}<br />
var myObj = new Operations(1, 2);<br />
console.log(myObj.add());<br />
[/js]</p>
<p>If you run the above code, you can see an output as follows.</p>
<div id="attachment_12136" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/JavaScript_Class_Output.png"><img decoding="async" aria-describedby="caption-attachment-12136" class="size-large wp-image-12136" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/JavaScript_Class_Output-1024x194.png" alt="JavaScript_Class_Output" width="634" height="120" srcset="/wp-content/uploads/2017/03/JavaScript_Class_Output-1024x194.png 1024w, /wp-content/uploads/2017/03/JavaScript_Class_Output-300x57.png 300w, /wp-content/uploads/2017/03/JavaScript_Class_Output-768x146.png 768w, /wp-content/uploads/2017/03/JavaScript_Class_Output-400x76.png 400w, /wp-content/uploads/2017/03/JavaScript_Class_Output.png 1066w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12136" class="wp-caption-text">JavaScript_Class_Output</p></div>
<p>Now how can you rewrite the above code to lower ECMAScript version? I leave it to you. You can always read more about ECMAScript6 <a href="http://es6-features.org/#ClassDefinition" target="_blank" rel="noopener">here</a>.</p>
<h4><strong>JSDoc</strong></h4>
<p>Documenting a JavaScript fucntion was a tough task, but not anymore. In VS2017, this makes simple. Let&#8217;s check it out. By pressing /** you can easily document your JavaScript functions and classes. Let us rewrite the class and function as preceding.</p>
<p>[js]<br />
/**<br />
* This class performs arithmetic operations<br />
*/<br />
class Operations {<br />
/**<br />
* Operations class constructor<br />
* @param {any} x<br />
* @param {any} y<br />
*/<br />
constructor(x, y) {<br />
this.x = x;<br />
this.y = y;<br />
}<br />
/**<br />
* Add function<br />
*/<br />
add() {<br />
return (this.x + this.y);<br />
}<br />
}<br />
var myObj = new Operations(1, 2);<br />
console.log(myObj.add());<br />
[/js]</p>
<p>You can even set the type of the parameter.</p>
<div id="attachment_12137" style="width: 606px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Set_default_type_for_the_parameter_in_JSDoc.png"><img decoding="async" aria-describedby="caption-attachment-12137" class="size-full wp-image-12137" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Set_default_type_for_the_parameter_in_JSDoc.png" alt="Set_default_type_for_the_parameter_in_JSDoc" width="596" height="505" srcset="/wp-content/uploads/2017/03/Set_default_type_for_the_parameter_in_JSDoc.png 596w, /wp-content/uploads/2017/03/Set_default_type_for_the_parameter_in_JSDoc-300x254.png 300w, /wp-content/uploads/2017/03/Set_default_type_for_the_parameter_in_JSDoc-400x339.png 400w" sizes="(max-width: 596px) 100vw, 596px" /></a><p id="caption-attachment-12137" class="wp-caption-text">Set_default_type_for_the_parameter_in_JSDoc</p></div>
<p>If you change the type in the JSDoc, the same will reflect in when you create an instances or calling the functions.</p>
<div id="attachment_12138" style="width: 621px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/JSDoc_reflects_while_creating_instances.png"><img decoding="async" aria-describedby="caption-attachment-12138" class="size-full wp-image-12138" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/JSDoc_reflects_while_creating_instances.png" alt="JSDoc_reflects_while_creating_instances" width="611" height="539" srcset="/wp-content/uploads/2017/03/JSDoc_reflects_while_creating_instances.png 611w, /wp-content/uploads/2017/03/JSDoc_reflects_while_creating_instances-300x265.png 300w, /wp-content/uploads/2017/03/JSDoc_reflects_while_creating_instances-400x353.png 400w" sizes="(max-width: 611px) 100vw, 611px" /></a><p id="caption-attachment-12138" class="wp-caption-text">JSDoc_reflects_while_creating_instances</p></div>
<h4><strong>New Rename options in JavaScript</strong></h4>
<p>You can now right click on any function name or class name and easily rename those in all references.</p>
<div id="attachment_12139" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/New_Rename_option_in_JavaScript.png"><img decoding="async" aria-describedby="caption-attachment-12139" class="size-large wp-image-12139" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/New_Rename_option_in_JavaScript-1024x323.png" alt="New_Rename_option_in_JavaScript" width="634" height="200" srcset="/wp-content/uploads/2017/03/New_Rename_option_in_JavaScript-1024x323.png 1024w, /wp-content/uploads/2017/03/New_Rename_option_in_JavaScript-300x95.png 300w, /wp-content/uploads/2017/03/New_Rename_option_in_JavaScript-768x242.png 768w, /wp-content/uploads/2017/03/New_Rename_option_in_JavaScript-400x126.png 400w, /wp-content/uploads/2017/03/New_Rename_option_in_JavaScript.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12139" class="wp-caption-text">New_Rename_option_in_JavaScript</p></div>
<h4><strong>Find all references of functions or classes</strong></h4>
<p>You can now find the references of your functions or classes easily, just right click and click on Find all references.</p>
<div id="attachment_12140" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Find_all_references_in_JavaScript-e1489509869508.png"><img decoding="async" aria-describedby="caption-attachment-12140" class="size-full wp-image-12140" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Find_all_references_in_JavaScript-e1489509869508.png" alt="Find_all_references_in_JavaScript" width="634" height="275" srcset="/wp-content/uploads/2017/03/Find_all_references_in_JavaScript-e1489509869508.png 634w, /wp-content/uploads/2017/03/Find_all_references_in_JavaScript-e1489509869508-300x130.png 300w, /wp-content/uploads/2017/03/Find_all_references_in_JavaScript-e1489509869508-400x174.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12140" class="wp-caption-text">Find_all_references_in_JavaScript</p></div>
<p>That&#8217;s all for today. I will come with another set of features of Visual Studio 2017 very soon. Happy coding!.</p>
<h3><strong>References</strong></h3>
<ul>
<li><a href="https://www.visualstudio.com/" target="_blank" rel="noopener">Visual Studio</a></li>
</ul>
<h3><strong>See also</strong></h3>
<ul>
<li><a href="http://sibeeshpassion.com/category/Visual-Studio/" target="_blank" rel="noopener">Articles related to Visual Studio</a></li>
</ul>
<h3><strong>Conclusion</strong></h3>
<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>
<h3><strong>Your turn. What do you think?</strong></h3>
<p>A blog isn’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/why-visual-studio-2017-let-us-try-it-part-two/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Why Visual Studio 2017? Let us try it.</title>
		<link>https://sibeeshpassion.com/why-visual-studio-2017-let-us-try-it/</link>
					<comments>https://sibeeshpassion.com/why-visual-studio-2017-let-us-try-it/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 07 Mar 2017 19:06:18 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Visual Studio 2017]]></category>
		<category><![CDATA[Advantages of Visual Studio 2017]]></category>
		<category><![CDATA[All about Visual Studio 2017]]></category>
		<category><![CDATA[Why Visual Studio 2017]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12102</guid>

					<description><![CDATA[[toc] Introduction Here we are going to a see some live actions of the brand new Visual Studio 2017. Please be noted that, this is not the complete series of new functionalities of Visual Studio 2017, here I am going to share only few things to get you started with the new Visual Studio 2017.I hope you will like this. Now let&#8217;s begin. Background Today, the wait is over. Visual Studio 2017 is here, so I thought of trying it out today itself. That&#8217;s how this article is made. If you never use Visual Studio, you can find some articles [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>Here we are going to a see some live actions of the brand new <a href="http://sibeeshpassion.com/category/Visual-Studio/" target="_blank" rel="noopener">Visual Studio</a> 2017. Please be noted that, this is not the complete series of new functionalities of Visual Studio 2017, here I am going to share only few things to get you started with the new Visual Studio 2017.I hope you will like this. Now let&#8217;s begin.</p>
<h3><strong>Background</strong></h3>
<p>Today, the wait is over. Visual Studio 2017 is here, so I thought of trying it out today itself. That&#8217;s how this article is made. If you never use Visual Studio, you can find some articles and code snippets relates to it <a href="http://sibeeshpassion.com/category/Visual-Studio/" target="_blank" rel="noopener">here</a></p>
<h3><strong>Installing Visual Studio 2017</strong></h3>
<p>You can always install the brand new Visual Studio 2017 from <a href="https://www.visualstudio.com/" target="_blank" rel="noopener">here</a>. While installing you can always select the things you may need, for example if you are a Xamarin developer, you can select the Xamarin. Visual Studio 2017 has the option for it. This makes the installation pretty much fast. Once after you install, it is time to launch.</p>
<div id="attachment_12103" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/After_installing_Visual_Studio_2017.png"><img decoding="async" aria-describedby="caption-attachment-12103" class="size-large wp-image-12103" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/After_installing_Visual_Studio_2017-1024x572.png" alt="After_installing_Visual_Studio_2017" width="634" height="354" srcset="/wp-content/uploads/2017/03/After_installing_Visual_Studio_2017-1024x572.png 1024w, /wp-content/uploads/2017/03/After_installing_Visual_Studio_2017-300x167.png 300w, /wp-content/uploads/2017/03/After_installing_Visual_Studio_2017-768x429.png 768w, /wp-content/uploads/2017/03/After_installing_Visual_Studio_2017-400x223.png 400w, /wp-content/uploads/2017/03/After_installing_Visual_Studio_2017-1075x600.png 1075w, /wp-content/uploads/2017/03/After_installing_Visual_Studio_2017.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12103" class="wp-caption-text">After_installing_Visual_Studio_2017</p></div>
<p>You can always set the development settings and the theme as per your wish, this features are already available in other lower versions too. Just thought to say it.</p>
<div id="attachment_12104" style="width: 590px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Selecting_theme_in_Visual_Studio_2017.png"><img decoding="async" aria-describedby="caption-attachment-12104" class="size-full wp-image-12104" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Selecting_theme_in_Visual_Studio_2017.png" alt="Selecting_theme_in_Visual_Studio_2017" width="580" height="712" srcset="/wp-content/uploads/2017/03/Selecting_theme_in_Visual_Studio_2017.png 580w, /wp-content/uploads/2017/03/Selecting_theme_in_Visual_Studio_2017-244x300.png 244w, /wp-content/uploads/2017/03/Selecting_theme_in_Visual_Studio_2017-400x491.png 400w, /wp-content/uploads/2017/03/Selecting_theme_in_Visual_Studio_2017-489x600.png 489w" sizes="(max-width: 580px) 100vw, 580px" /></a><p id="caption-attachment-12104" class="wp-caption-text">Selecting_theme_in_Visual_Studio_2017</p></div>
<h3>New features of Visual Studio 2017</h3>
<h4><strong>Recent, Open, New project template</strong></h4>
<p>In the start screen, you can see some slight changes like preceding.</p>
<h5>Recent</h5>
<p>This is where your recent projects will be shown, so that you can easily open it up.</p>
<h5>Open</h5>
<p>This, helps you to open the projects you need in an easy manner. It is not only helping to open a project from your local computer, but also from Visual Studio Team services. Things are pretty much easier now. Right?</p>
<h5>New project</h5>
<p>Here you can see the templates that you recently worked with, and you can always search the templates too.</p>
<div id="attachment_12105" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Recent_menu_and_open_menu_in_Visual_Studio_2017.png"><img decoding="async" aria-describedby="caption-attachment-12105" class="size-large wp-image-12105" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Recent_menu_and_open_menu_in_Visual_Studio_2017-1024x618.png" alt="Recent_menu_and_open_menu_in_Visual_Studio_2017" width="634" height="383" srcset="/wp-content/uploads/2017/03/Recent_menu_and_open_menu_in_Visual_Studio_2017-1024x618.png 1024w, /wp-content/uploads/2017/03/Recent_menu_and_open_menu_in_Visual_Studio_2017-300x181.png 300w, /wp-content/uploads/2017/03/Recent_menu_and_open_menu_in_Visual_Studio_2017-768x464.png 768w, /wp-content/uploads/2017/03/Recent_menu_and_open_menu_in_Visual_Studio_2017-660x400.png 660w, /wp-content/uploads/2017/03/Recent_menu_and_open_menu_in_Visual_Studio_2017-400x242.png 400w, /wp-content/uploads/2017/03/Recent_menu_and_open_menu_in_Visual_Studio_2017-994x600.png 994w, /wp-content/uploads/2017/03/Recent_menu_and_open_menu_in_Visual_Studio_2017.png 1434w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12105" class="wp-caption-text">Recent_menu_and_open_menu_in_Visual_Studio_2017</p></div>
<h3><strong>Creating first Visual Studio </strong><b>Application</b></h3>
<p>Now, let&#8217;s create an empty MVC application and a controller in it.</p>
<p>[csharp]<br />
namespace WhyVisualStudio2017.Controllers<br />
{<br />
public class HomeController : Controller<br />
{<br />
// GET: Home<br />
public ActionResult Index()<br />
{<br />
return View();<br />
}<br />
}<br />
}<br />
[/csharp]</p>
<p>Now if you look at the preceding image, you can see that there is a dotted lines between the namespaces, classes, methods.</p>
<div id="attachment_12106" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/New_layered_structure-e1488909640446.png"><img decoding="async" aria-describedby="caption-attachment-12106" class="size-full wp-image-12106" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/New_layered_structure-e1488909640446.png" alt="New_layered_structure" width="634" height="325" srcset="/wp-content/uploads/2017/03/New_layered_structure-e1488909640446.png 634w, /wp-content/uploads/2017/03/New_layered_structure-e1488909640446-300x154.png 300w, /wp-content/uploads/2017/03/New_layered_structure-e1488909640446-400x205.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12106" class="wp-caption-text">New_layered_structure</p></div>
<p>This will help you to understand how the namespaces, class, methods are related to. If you have worked in heavy projects where you can have 1000&#8217;s lines of codes in a single class, you may find this feature very useful.</p>
<p>Now let&#8217;s create a model class as preceding.</p>
<p>[csharp]<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Web;</p>
<p>namespace WhyVisualStudio2017.Models<br />
{<br />
public class Calculator<br />
{<br />
public static int CalculateMe(int v1, int v2)<br />
{<br />
return v1 * v2;<br />
}<br />
}<br />
}<br />
[/csharp]</p>
<p>Go back to your controller and type &#8216;cal&#8217;, you can see the new intellisense, where you can separate the lists by classes, snippets, interfaces etc.</p>
<div id="attachment_12107" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/New_Intellisense_feature-e1488909967394.png"><img decoding="async" aria-describedby="caption-attachment-12107" class="size-full wp-image-12107" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/New_Intellisense_feature-e1488909967394.png" alt="New_Intellisense_feature" width="634" height="371" srcset="/wp-content/uploads/2017/03/New_Intellisense_feature-e1488909967394.png 634w, /wp-content/uploads/2017/03/New_Intellisense_feature-e1488909967394-300x176.png 300w, /wp-content/uploads/2017/03/New_Intellisense_feature-e1488909967394-400x234.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12107" class="wp-caption-text">New_Intellisense_feature</p></div>
<div id="attachment_12108" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/New_Intellisense_feature_2-e1488910028540.png"><img decoding="async" aria-describedby="caption-attachment-12108" class="size-full wp-image-12108" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/New_Intellisense_feature_2-e1488910028540.png" alt="New_Intellisense_feature" width="634" height="320" srcset="/wp-content/uploads/2017/03/New_Intellisense_feature_2-e1488910028540.png 634w, /wp-content/uploads/2017/03/New_Intellisense_feature_2-e1488910028540-300x151.png 300w, /wp-content/uploads/2017/03/New_Intellisense_feature_2-e1488910028540-400x202.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12108" class="wp-caption-text">New_Intellisense_feature</p></div>
<p>Now, if you have given your function name as in camel Case manner, the Visual Studio 2017 will give a suggestion to rename it as preceding.</p>
<div id="attachment_12109" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Naming_Suggestions_in_Visual_Studio-e1488910305475.png"><img decoding="async" aria-describedby="caption-attachment-12109" class="size-full wp-image-12109" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Naming_Suggestions_in_Visual_Studio-e1488910305475.png" alt="Naming_Suggestions_in_Visual_Studio" width="634" height="343" srcset="/wp-content/uploads/2017/03/Naming_Suggestions_in_Visual_Studio-e1488910305475.png 634w, /wp-content/uploads/2017/03/Naming_Suggestions_in_Visual_Studio-e1488910305475-300x162.png 300w, /wp-content/uploads/2017/03/Naming_Suggestions_in_Visual_Studio-e1488910305475-400x216.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12109" class="wp-caption-text">Naming_Suggestions_in_Visual_Studio</p></div>
<p>As an additional feature, if you click on the preview changes, you can get to know where exactly your recent code changes may affect and what fix you can give.</p>
<div id="attachment_12110" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Preview_Changes_in_Visual_Studio-e1488910424329.png"><img decoding="async" aria-describedby="caption-attachment-12110" class="size-full wp-image-12110" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Preview_Changes_in_Visual_Studio-e1488910424329.png" alt="Preview_Changes_in_Visual_Studio" width="634" height="483" srcset="/wp-content/uploads/2017/03/Preview_Changes_in_Visual_Studio-e1488910424329.png 469w, /wp-content/uploads/2017/03/Preview_Changes_in_Visual_Studio-e1488910424329-300x229.png 300w, /wp-content/uploads/2017/03/Preview_Changes_in_Visual_Studio-e1488910424329-400x305.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12110" class="wp-caption-text">Preview_Changes_in_Visual_Studio</p></div>
<p>Searching for a file is quite easier in Visual Studio 2017, all you have to do is type CTRl + T, then you can see a box as preceding.</p>
<div id="attachment_12111" style="width: 573px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Find_files_in_Visual_Studio_2017.png"><img decoding="async" aria-describedby="caption-attachment-12111" class="size-full wp-image-12111" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Find_files_in_Visual_Studio_2017.png" alt="Find_files_in_Visual_Studio_2017" width="563" height="68" srcset="/wp-content/uploads/2017/03/Find_files_in_Visual_Studio_2017.png 563w, /wp-content/uploads/2017/03/Find_files_in_Visual_Studio_2017-300x36.png 300w, /wp-content/uploads/2017/03/Find_files_in_Visual_Studio_2017-400x48.png 400w" sizes="(max-width: 563px) 100vw, 563px" /></a><p id="caption-attachment-12111" class="wp-caption-text">Find_files_in_Visual_Studio_2017</p></div>
<p>You can select any kind of files by typing the file name as preceding.</p>
<div id="attachment_12112" style="width: 573px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_3.png"><img decoding="async" aria-describedby="caption-attachment-12112" class="size-full wp-image-12112" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_3.png" alt="Find_Files_in_Visual_Studio" width="563" height="264" srcset="/wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_3.png 563w, /wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_3-300x141.png 300w, /wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_3-400x188.png 400w" sizes="(max-width: 563px) 100vw, 563px" /></a><p id="caption-attachment-12112" class="wp-caption-text">Find_Files_in_Visual_Studio</p></div>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_2.png"><img decoding="async" class="alignnone size-large wp-image-12113" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_2-1024x346.png" alt="" width="634" height="214" srcset="/wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_2-1024x346.png 1024w, /wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_2-300x101.png 300w, /wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_2-768x259.png 768w, /wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_2-400x135.png 400w, /wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_2.png 1374w" sizes="(max-width: 634px) 100vw, 634px" /></a> <a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_1.png"><img decoding="async" class="alignnone size-large wp-image-12114" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_1.png" alt="" width="563" height="215" srcset="/wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_1.png 563w, /wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_1-300x115.png 300w, /wp-content/uploads/2017/03/Find_Files_in_Visual_Studio_1-400x153.png 400w" sizes="(max-width: 563px) 100vw, 563px" /></a></p>
<p>You can always use the filters given there in the box.</p>
<p>Another important feature available in Visual Studio 2017 is, Exception User Handled. If you get any error, the Visual Studio 2017 will say you where exactly the error is. For example, we all know the preceding codeblock will give you a null reference exception.</p>
<p>[csharp]<br />
List&lt;string&gt; lstString = new List&lt;string&gt;();<br />
lstString = null;<br />
lstString.Add(&#8220;Sibeesh&#8221;);<br />
[/csharp]</p>
<p>Now, if you run your application, Visual Studio 2017 will give you the entire details of the error as preceding.</p>
<div id="attachment_12115" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/03/Exception_User_Handled_In_Visual_Studio_2017-e1488913396662.png"><img decoding="async" aria-describedby="caption-attachment-12115" class="size-full wp-image-12115" src="http://sibeeshpassion.com/wp-content/uploads/2017/03/Exception_User_Handled_In_Visual_Studio_2017-e1488913396662.png" alt="Exception_User_Handled_In_Visual_Studio_2017" width="634" height="325" srcset="/wp-content/uploads/2017/03/Exception_User_Handled_In_Visual_Studio_2017-e1488913396662.png 634w, /wp-content/uploads/2017/03/Exception_User_Handled_In_Visual_Studio_2017-e1488913396662-300x154.png 300w, /wp-content/uploads/2017/03/Exception_User_Handled_In_Visual_Studio_2017-e1488913396662-400x205.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12115" class="wp-caption-text">Exception_User_Handled_In_Visual_Studio_2017</p></div>
<p>In the exception box, it is been mentioned as <em>lstString was null</em>. For every developer, one of the head ache is finding where exactly the error occurs. Now Visual Studio 2017 makes that much easier. Way to go. That&#8217;s all for today. I will come with all the features of Visual Studio 2017 very soon. Happy coding!.</p>
<h3><strong>References</strong></h3>
<ul>
<li><a href="https://www.visualstudio.com/" target="_blank" rel="noopener">Visual Studio</a></li>
</ul>
<h3><strong>See also</strong></h3>
<ul>
<li><a href="http://sibeeshpassion.com/category/Visual-Studio/" target="_blank" rel="noopener">Articles related to Visual Studio</a></li>
</ul>
<h3><strong>Conclusion</strong></h3>
<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>
<h3><strong>Your turn. What do you think?</strong></h3>
<p>A blog isn’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/why-visual-studio-2017-let-us-try-it/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>Working With Azure Media Service Account</title>
		<link>https://sibeeshpassion.com/working-with-azure-media-service-account/</link>
					<comments>https://sibeeshpassion.com/working-with-azure-media-service-account/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 25 May 2016 00:00:36 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Create an Asset dynamically via console application]]></category>
		<category><![CDATA[Media Service]]></category>
		<category><![CDATA[Media service account]]></category>
		<category><![CDATA[Retrieving the items from the Asset]]></category>
		<category><![CDATA[Uploading image to the assets]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11635</guid>

					<description><![CDATA[[toc] Introduction In this article we are going to work with Media Service Account in Azure. Once we create a media service account, we will create a console application in which we will add the operations like creating the media assets dynamically. You can also upload some files to the assets created. We will discuss here that too. I hope you will like this. Download the source code You can always download the source code here: Azure Media Service Background Few days back I have got a requirement of storing some files in the cloud. As you all know, Azure [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>In this article we are going to work with Media Service Account in <a href="http://sibeeshpassion.com/category/Azure/" target="_blank" rel="noopener">Azure</a>. Once we create a media service account, we will create a console application in which we will add the operations like creating the media assets dynamically. You can also upload some files to the assets created. We will discuss here that too. I hope you will like this.</p>
<h3>Download the source code</h3>
<p>You can always download the source code here: <a href="https://code.msdn.microsoft.com/Working-With-Azure-Media-ad283589" target="_blank" rel="noopener">Azure Media Service</a></p>
<h3>Background</h3>
<p>Few days back I have got a requirement of storing some files in the cloud. As you all know, <a href="http://sibeeshpassion.com/category/Azure/" target="_blank" rel="noopener">Azure </a>will be the right choice if you talk about the cloud services. And I had account with Azure already, so the things were pretty much easy for me. Thus I decided to create a media service account for this requirement. Here we are going to see how we can create an Azure media service account and how to use the same. Following are the prerequisites.</p>
<h3>What is media service account?</h3>
<li>A media service account is a Azure based account which gives you access to cloud based media services in Azure.</li>
<li>Stores metadata of the media files you create, instead saving the actual media content.</li>
<li>To work with media service account, you must have an associated storage account.</li>
<li>While creating a media service account, you can either select the storage account you already have or you can create a new one.</li>
<li>Since the media service account and storage account is treated separately, the content will be available in your storage account even if you delete your media service account</li>
<blockquote><p>
Please be noted that your storage account region must be same as your media service account region.
</p></blockquote>
<h3>Prerequisites</h3>
<li>Visual Studio</li>
<li>Azure account with active subscription</li>
<p>If you are a start up company or you are in thinking to start a one, you can always go for BizSpark(Software and services made for the start ups), to join please check here: <a href="http://sibeeshpassion.com/how-to-join-bizspark/" target="_blank" rel="noopener">How to join bizspark</a>. Or you can always create a free account <a href="https://azure.microsoft.com/en-in/pricing/free-trial/" target="_blank" rel="noopener">here</a>.</p>
<h3>Things we are going to do</h3>
<p>The following are the tasks we are going to do.</p>
<li>Creating an Azure media service account.</li>
<p>If you don&#8217;t have an Azure account with active subscription, you must creates it first before going to do this task.</p>
<li>Creating a Console application to use Media service account</li>
<li>Create an Asset dynamically via console application</li>
<li>Uploading image to the assets</li>
<li>Retrieving the items from the Asset</li>
<p>Now we will go and create our media service account.</p>
<h3>Steps to create an Azure media service account</h3>
<p>To create an azure media service account, please follows the preceding steps. </p>
<p>Step 1: Login to your Azure Portal (<a href="https://portal.azure.com" target="_blank" rel="noopener">https://portal.azure.com</a>)</p>
<div id="attachment_11636" style="width: 467px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/Azure-Home.png"><img decoding="async" aria-describedby="caption-attachment-11636" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/Azure-Home.png" alt="Azure Home" width="457" height="587" class="size-full wp-image-11636" srcset="/wp-content/uploads/2016/05/Azure-Home.png 457w, /wp-content/uploads/2016/05/Azure-Home-234x300.png 234w, /wp-content/uploads/2016/05/Azure-Home-400x514.png 400w" sizes="(max-width: 457px) 100vw, 457px" /></a><p id="caption-attachment-11636" class="wp-caption-text">Azure Home</p></div>
<p>Step 2: Click New and select Media + CDN</p>
<div id="attachment_11637" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/Media-And-CDN-e1464160195844.png"><img decoding="async" aria-describedby="caption-attachment-11637" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/Media-And-CDN-e1464160195844.png" alt="Media And CDN" width="650" height="463" class="size-full wp-image-11637" srcset="/wp-content/uploads/2016/05/Media-And-CDN-e1464160195844.png 501w, /wp-content/uploads/2016/05/Media-And-CDN-e1464160195844-300x214.png 300w, /wp-content/uploads/2016/05/Media-And-CDN-e1464160195844-400x285.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11637" class="wp-caption-text">Media And CDN</p></div>
<p>Step 3: Click on the media service</p>
<p>This will redirect you to <a href="https://manage.windowsazure.com" target="_blank" rel="noopener">old azure portal</a>, If you are not redirected, no worries. It is fine. </p>
<div id="attachment_11638" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/Media-Service-e1464160366877.png"><img decoding="async" aria-describedby="caption-attachment-11638" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/Media-Service-e1464160366877.png" alt="Media Service" width="650" height="355" class="size-full wp-image-11638" srcset="/wp-content/uploads/2016/05/Media-Service-e1464160366877.png 650w, /wp-content/uploads/2016/05/Media-Service-e1464160366877-300x164.png 300w, /wp-content/uploads/2016/05/Media-Service-e1464160366877-400x218.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11638" class="wp-caption-text">Media Service</p></div>
<p>Step 4: Give the details.</p>
<div id="attachment_11639" style="width: 381px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/New-Storage-Account.png"><img decoding="async" aria-describedby="caption-attachment-11639" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/New-Storage-Account.png" alt="New Storage Account" width="371" height="477" class="size-full wp-image-11639" srcset="/wp-content/uploads/2016/05/New-Storage-Account.png 371w, /wp-content/uploads/2016/05/New-Storage-Account-233x300.png 233w" sizes="(max-width: 371px) 100vw, 371px" /></a><p id="caption-attachment-11639" class="wp-caption-text">New Storage Account</p></div>
<p>Here you can select if you have a storage account or a new one will be created for you automatically. </p>
<p>Step 5: Finish </p>
<p>Once you give the needed details, you can click on the tick symbol. </p>
<div id="attachment_11640" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/Media-Service-Created-e1464160595700.png"><img decoding="async" aria-describedby="caption-attachment-11640" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/Media-Service-Created-e1464160595700.png" alt="Media Service Created" width="650" height="160" class="size-full wp-image-11640" srcset="/wp-content/uploads/2016/05/Media-Service-Created-e1464160595700.png 650w, /wp-content/uploads/2016/05/Media-Service-Created-e1464160595700-300x74.png 300w, /wp-content/uploads/2016/05/Media-Service-Created-e1464160595700-400x98.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11640" class="wp-caption-text">Media Service Created</p></div>
<p>Now we have our storage account and media service account with us. You can always download the sample applications given there. What you need to do all is just select the language you wish and click on the download link. We will create a console application to use this media service account. Sounds cool?</p>
<h3>Creating a Console application to use Media service account</h3>
<p>To create a console application in <a href="http://sibeeshpassion.com/category/visual-studio/" target="_blank" rel="noopener">Visual Studio</a> click File->New project-> Select language->Select Console Application.</p>
<p>Now go back to your Azure portal and click on Manage Keys at the bottom, copy the MEDIA SERVICE ACCOUNT NAME and  MEDIA SERVICE ACCESS KEY (Either primary or secondary). Then you need to add the settings as appSettings in your App.config file as follows. </p>
<p>[xml]<br />
&lt;appSettings&gt;<br />
    &lt;add key=&quot;MediaServicesAccountName&quot; value=&quot;****&quot; /&gt;<br />
    &lt;add key=&quot;MediaServicesAccountKey&quot; value=&quot;***************************&quot; /&gt;<br />
  &lt;/appSettings&gt;<br />
[/xml]</p>
<p>The next thing you need to do is installing <em>windowsazure.mediaservices </em>from package manager console. For that please go to your package manger console from NuGet Package Manager. And run the below query.</p>
<p>[csharp]<br />
 install-package windowsazure.mediaservices<br />
[/csharp]</p>
<p>Now you need to include the preceding namespace to get started with.</p>
<p>[csharp]<br />
using Microsoft.WindowsAzure.MediaServices.Client;<br />
[/csharp]</p>
<p>Now change your Program.cs codes as follows</p>
<p>[csharp]<br />
using Microsoft.WindowsAzure.MediaServices.Client;<br />
using System;<br />
using System.Configuration;</p>
<p>namespace AzureMediaServiceApp<br />
{<br />
    class Program<br />
    {<br />
        #region Constants<br />
        private static string mediaServicesAccountName = ConfigurationManager.AppSettings[&quot;MediaServicesAccountName&quot;];<br />
        private static string mediaServicesAccountKey = ConfigurationManager.AppSettings[&quot;MediaServicesAccountKey&quot;];<br />
        #endregion<br />
        static void Main(string[] args)<br />
        {<br />
            string input = string.Empty;<br />
            Console.WriteLine(&quot;Enter the asset name to be created&#8230;&quot;);<br />
            input = Console.ReadLine();<br />
            CreateBLOBContainer(input);<br />
        }<br />
        public static string CreateBLOBContainer(string containerName)<br />
        {<br />
            try<br />
            {<br />
                string result = string.Empty;<br />
                CloudMediaContext mediaContext;<br />
                mediaContext = new CloudMediaContext(mediaServicesAccountName, mediaServicesAccountKey);<br />
                IAsset asset = mediaContext.Assets.Create(containerName, AssetCreationOptions.None);<br />
                return asset.Uri.ToString();<br />
            }<br />
            catch (Exception ex)<br />
            {<br />
                return ex.Message;<br />
            }<br />
        }<br />
    }<br />
}<br />
[/csharp]</p>
<p>What we are doing in the above code is, we are fetching the account details from the App.config and calling a function <em>CreateBLOBContainer</em> with the name of the asset as a parameter. We will ask for this name in the console window. Sounds good?</p>
<div id="attachment_11642" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/Media-Service-Created-Output-e1464167236811.png"><img decoding="async" aria-describedby="caption-attachment-11642" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/Media-Service-Created-Output-e1464167236811.png" alt="Media Service Created Output" width="650" height="327" class="size-full wp-image-11642" srcset="/wp-content/uploads/2016/05/Media-Service-Created-Output-e1464167236811.png 650w, /wp-content/uploads/2016/05/Media-Service-Created-Output-e1464167236811-300x151.png 300w, /wp-content/uploads/2016/05/Media-Service-Created-Output-e1464167236811-400x201.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11642" class="wp-caption-text">Media Service Created Output</p></div>
<p>Now go back to your azure portal and click on content tab, you can see the asset you are just created. </p>
<div id="attachment_11643" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/Media-Service-Created-Azure-Portal-Output-e1464167401891.png"><img decoding="async" aria-describedby="caption-attachment-11643" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/Media-Service-Created-Azure-Portal-Output-e1464167401891.png" alt="Media Service Created Azure Portal Output" width="650" height="136" class="size-full wp-image-11643" srcset="/wp-content/uploads/2016/05/Media-Service-Created-Azure-Portal-Output-e1464167401891.png 650w, /wp-content/uploads/2016/05/Media-Service-Created-Azure-Portal-Output-e1464167401891-300x63.png 300w, /wp-content/uploads/2016/05/Media-Service-Created-Azure-Portal-Output-e1464167401891-400x84.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11643" class="wp-caption-text">Media Service Created Azure Portal Output</p></div>
<p>Now we will create a function which will upload some files to asset. So that we will change our Program.cs file as follows.</p>
<p>[csharp]<br />
using Microsoft.WindowsAzure.MediaServices.Client;<br />
using System;<br />
using System.Configuration;<br />
using System.IO;</p>
<p>namespace AzureMediaServiceApp<br />
{<br />
    class Program<br />
    {<br />
        #region Constants<br />
        private static readonly string mediaServicesAccountName = ConfigurationManager.AppSettings[&quot;MediaServicesAccountName&quot;];<br />
        private static readonly string mediaServicesAccountKey = ConfigurationManager.AppSettings[&quot;MediaServicesAccountKey&quot;];<br />
        private static readonly string myAzureCon = ConfigurationManager.ConnectionStrings[&quot;myAzureStorageCon&quot;].ConnectionString;<br />
        private static MediaServicesCredentials _mediaServiceCredentials = null;<br />
        #endregion<br />
        static void Main(string[] args)<br />
        {<br />
            string input = string.Empty;<br />
            Console.WriteLine(&quot;Enter the asset name to be created&#8230;&quot;);<br />
            input = Console.ReadLine();<br />
            _mediaServiceCredentials = new MediaServicesCredentials(mediaServicesAccountName, mediaServicesAccountKey);<br />
            IAsset asset = CreateBLOBContainer(input, _mediaServiceCredentials);<br />
            UploadImages(asset, _mediaServiceCredentials);<br />
        }<br />
        public static IAsset CreateBLOBContainer(string containerName, MediaServicesCredentials _medServCredentials)<br />
        {<br />
            try<br />
            {<br />
                string result = string.Empty;<br />
                CloudMediaContext mediaContext;<br />
                mediaContext = new CloudMediaContext(_medServCredentials);<br />
                IAsset asset = mediaContext.Assets.Create(containerName, AssetCreationOptions.None);<br />
                return asset;</p>
<p>            }<br />
            catch (Exception)<br />
            {<br />
                throw;<br />
            }<br />
        }<br />
        public static string UploadImages(IAsset asset, MediaServicesCredentials _medServCredentials)<br />
        {<br />
            try<br />
            {<br />
                string _singleInputFilePath = Path.GetFullPath(@&quot;E:\X7Md4VB.JPG&quot;);<br />
                CloudMediaContext mediaContext;<br />
                mediaContext = new CloudMediaContext(_medServCredentials);<br />
                var fileName = Path.GetFileName(_singleInputFilePath);<br />
                var assetFile = asset.AssetFiles.Create(fileName);<br />
                var policy = mediaContext.AccessPolicies.Create(&quot;policy for upload&quot;, TimeSpan.FromMinutes(30), AccessPermissions.Read | AccessPermissions.Write | AccessPermissions.List);<br />
                var locator = mediaContext.Locators.CreateSasLocator(asset, policy, DateTime.UtcNow.AddDays(1));<br />
                assetFile.Upload(_singleInputFilePath);<br />
                return &quot;Success!&quot;;<br />
            }<br />
            catch (Exception)<br />
            {<br />
                throw;<br />
            }<br />
        }<br />
    }<br />
}<br />
[/csharp]</p>
<p>Here we calls a function <em>UploadImages</em> which accepts IAsset and MediaServicesCredentials as a parameter to upload the images to the asset we created. Once you run this, you can see that image has been uploaded in your asset. To check that, please go to your Azure portal and see your asset size in content tab. I am sure that the size must be changed. </p>
<div id="attachment_11644" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/Image-uploaded-to-Media-Service-e1464177194192.png"><img decoding="async" aria-describedby="caption-attachment-11644" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/Image-uploaded-to-Media-Service-e1464177194192.png" alt="Image uploaded to Media Service" width="650" height="105" class="size-full wp-image-11644" srcset="/wp-content/uploads/2016/05/Image-uploaded-to-Media-Service-e1464177194192.png 650w, /wp-content/uploads/2016/05/Image-uploaded-to-Media-Service-e1464177194192-300x48.png 300w, /wp-content/uploads/2016/05/Image-uploaded-to-Media-Service-e1464177194192-400x65.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11644" class="wp-caption-text">Image uploaded to Media Service</p></div>
<p>Now we will list down all the items we saved to the asset. Shall we?</p>
<p><strong>Retrieving the items from the Asset</strong></p>
<p>To retrieve the items we will add an another function as follows. </p>
<p>[csharp]<br />
 private static void GetAllTheAssetsAndFiles(MediaServicesCredentials _medServCredentials)<br />
        {<br />
            try<br />
            {<br />
                string result = string.Empty;<br />
                CloudMediaContext mediaContext;<br />
                mediaContext = new CloudMediaContext(_medServCredentials);<br />
                StringBuilder myBuilder = new StringBuilder();<br />
                foreach (var item in mediaContext.Assets)<br />
                {<br />
                    myBuilder.AppendLine(Environment.NewLine);<br />
                    myBuilder.AppendLine(&quot;&#8211;My Assets&#8211;&quot;);<br />
                    myBuilder.AppendLine(&quot;Name: &quot; + item.Name);<br />
                    myBuilder.AppendLine(&quot;++++++++++++++++++++&quot;);</p>
<p>                    foreach (var subItem in item.AssetFiles)<br />
                    {<br />
                        myBuilder.AppendLine(&quot;File Name: &quot;+subItem.Name);<br />
                        myBuilder.AppendLine(&quot;Size: &quot; + subItem.ContentFileSize);<br />
                        myBuilder.AppendLine(&quot;++++++++++++++++++++++&quot;);<br />
                    }<br />
                }<br />
                Console.WriteLine(myBuilder);<br />
            }<br />
            catch (Exception)<br />
            {<br />
                throw;<br />
            }<br />
        }<br />
[/csharp]</p>
<p>And it will give you an output as follows. </p>
<div id="attachment_11645" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/My-Assets-and-contents.png"><img decoding="async" aria-describedby="caption-attachment-11645" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/My-Assets-and-contents-e1464178390636.png" alt="My Assets and contents" width="650" height="327" class="size-full wp-image-11645" srcset="/wp-content/uploads/2016/05/My-Assets-and-contents-e1464178390636.png 650w, /wp-content/uploads/2016/05/My-Assets-and-contents-e1464178390636-300x151.png 300w, /wp-content/uploads/2016/05/My-Assets-and-contents-e1464178390636-400x201.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11645" class="wp-caption-text">My Assets and contents</p></div>
<h3>Conclusion</h3>
<p>Did I miss anything that you may think which is needed? Have you ever tried Azure media service account? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h3>Your turn. What do you think?</h3>
<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-azure-media-service-account/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Load Data From Database Using Web API</title>
		<link>https://sibeeshpassion.com/load-data-from-database-using-web-api/</link>
					<comments>https://sibeeshpassion.com/load-data-from-database-using-web-api/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sat, 31 Oct 2015 11:08:57 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Web API]]></category>
		<category><![CDATA[CRUD in MVC]]></category>
		<category><![CDATA[Load Data From Database Using Web API]]></category>
		<category><![CDATA[MVC4]]></category>
		<category><![CDATA[MVC5]]></category>
		<category><![CDATA[Visual Studio 2013]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10141</guid>

					<description><![CDATA[In this article we will learn about Loading Data From Database in MVC using Web API. We will use Visual Studio 2015 to create a Web API and performs the operations. In this project we are going to create a database and a table called tbl_Subcribers which actually contains a list of data. We will use our normal jQuery ajax to call the Web API, once the data is ready we will format the same in an html table. I hope you will like this. Download the source code Load Data From Database Using Web API Background What is a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this article we will learn about Loading Data From Database in <a href="http://sibeeshpassion.com/tag/mvc/" target="_blank" rel="noopener">MVC </a> using Web API. We will use <a href="http://sibeeshpassion.com/tag/visual-studio/" target="_blank" rel="noopener">Visual Studio</a> 2015 to create a Web API and performs the operations. In this project we are going to create a <em><a href="http://sibeeshpassion.com/tag/database/" target="_blank" rel="noopener"> database </a></em> and a table called <em>tbl_Subcribers</em> which actually contains a list of data. We will use our normal jQuery ajax to call the Web API, once the data is ready we will format the same in an html table. I hope you will like this. </p>
<p><strong>Download the source code</strong></p>
<li><a href="https://code.msdn.microsoft.com/Load-Data-From-Database-59a20734" target="_blank" rel="noopener">Load Data From Database Using Web API</a></li>
<p><strong>Background</strong></p>
<p><em>What is a Web API?</em></p>
<p>A Web API is a kind of a framework which makes building HTTP services easier than ever. It can be used almost everywhere including wide range of clients, mobile devices, browsers etc. It contains normal MVC features like Model, Controller, Actions, Routing etc. Support all HTTP verbs like POST, GET, DELETE, PUT. </p>
<div id="attachment_10874" style="width: 560px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Why-Web-API.png"><img decoding="async" aria-describedby="caption-attachment-10874" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Why-Web-API.png" alt="Why Web API" width="550" height="377" class="size-full wp-image-10874" srcset="/wp-content/uploads/2015/10/Why-Web-API.png 550w, /wp-content/uploads/2015/10/Why-Web-API-300x206.png 300w, /wp-content/uploads/2015/10/Why-Web-API-320x218.png 320w, /wp-content/uploads/2015/10/Why-Web-API-160x110.png 160w, /wp-content/uploads/2015/10/Why-Web-API-400x274.png 400w" sizes="(max-width: 550px) 100vw, 550px" /></a><p id="caption-attachment-10874" class="wp-caption-text">Why Web API</p></div>
<p><em>Image Courtesy : blogs.msdn.com</em></p>
<div id="attachment_10875" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Why-Web-API1-e1446290457816.png"><img decoding="async" aria-describedby="caption-attachment-10875" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Why-Web-API1-e1446290457816.png" alt="Why Web API" width="650" height="454" class="size-full wp-image-10875" srcset="/wp-content/uploads/2015/10/Why-Web-API1-e1446290457816.png 650w, /wp-content/uploads/2015/10/Why-Web-API1-e1446290457816-300x210.png 300w, /wp-content/uploads/2015/10/Why-Web-API1-e1446290457816-400x279.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10875" class="wp-caption-text">Why Web API</p></div>
<p><em>Image Courtesy : forums.asp.net</em></p>
<p><strong>Using the code</strong></p>
<p>We will create our project in Visual Studio 2015. To create a project click File-> New-> Project.</p>
<div id="attachment_10151" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_1-e1440410870120.png"><img decoding="async" aria-describedby="caption-attachment-10151" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_1-e1440410870120.png" alt="CRUD_in_MVC_Using_Web_API" width="650" height="450" class="size-full wp-image-10151" srcset="/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_1-e1440410870120.png 650w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_1-e1440410870120-300x208.png 300w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_1-e1440410870120-160x110.png 160w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_1-e1440410870120-400x277.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10151" class="wp-caption-text">CRUD_in_MVC_Using_Web_API</p></div>
<div id="attachment_10161" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_2-e1440410926817.png"><img decoding="async" aria-describedby="caption-attachment-10161" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_2-e1440410926817.png" alt="CRUD_in_MVC_Using_Web_API" width="650" height="590" class="size-full wp-image-10161" srcset="/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_2-e1440410926817.png 393w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_2-e1440410926817-300x272.png 300w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_2-e1440410926817-400x363.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10161" class="wp-caption-text"><br />CRUD_in_MVC_Using_Web_API</p></div>
<p><strong>Create a control</strong></p>
<p>Now we will create a control in our project.</p>
<div id="attachment_10171" style="width: 662px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Adding_Control.png"><img decoding="async" aria-describedby="caption-attachment-10171" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Adding_Control.png" alt="CRUD_in_MVC_Using_Web_API_Adding_Control" width="652" height="596" class="size-full wp-image-10171" srcset="/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Adding_Control.png 652w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Adding_Control-300x274.png 300w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Adding_Control-400x366.png 400w" sizes="(max-width: 652px) 100vw, 652px" /></a><p id="caption-attachment-10171" class="wp-caption-text">CRUD_in_MVC_Using_Web_API_Adding_Control</p></div>
<p>Select <em>Empty API Controller</em> as template.</p>
<div id="attachment_10191" style="width: 648px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Select_APIControl.png"><img decoding="async" aria-describedby="caption-attachment-10191" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Select_APIControl.png" alt="CRUD_in_MVC_Using_Web_API_Select_APIControl" width="638" height="430" class="size-full wp-image-10191" srcset="/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Select_APIControl.png 638w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Select_APIControl-300x202.png 300w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Select_APIControl-400x270.png 400w" sizes="(max-width: 638px) 100vw, 638px" /></a><p id="caption-attachment-10191" class="wp-caption-text">CRUD_in_MVC_Using_Web_API_Select_APIControl</p></div>
<p>As you can notice that we have selected Empty API Controller instead of selecting a normal controller. There are few difference between our normal controller and Empty API Controller. </p>
<p><strong>Controller VS Empty API Controller</strong></p>
<p>A controller normally render your views. But an API controller returns the data which is already serialized. A controller action returns JSON() by converting the data. You can get rid of this by using API controller.</p>
<p>Find out more: <a href="http://stackoverflow.com/questions/9494966/difference-between-apicontroller-and-controller-in-asp-net-mvc" target="_blank" rel="noopener">Controller VS API Controller </a></p>
<p><strong>Create a model</strong></p>
<p>As you all know, we write logic in a class called model in MVC. So next step what we need to do is creating a model. </p>
<p>Right click on Model and click Add new Items and then class. Name it as Subscribers. We are going to handle the subscriber list who all are subscribed to your website.</p>
<p>Now we will create a Database to our application.</p>
<p><strong>Create Database</strong></p>
<div id="attachment_10201" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Create_Database-e1440412525937.png"><img decoding="async" aria-describedby="caption-attachment-10201" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Create_Database-e1440412525937.png" alt="CRUD_in_MVC_Using_Web_API_Create_Database" width="650" height="449" class="size-full wp-image-10201" srcset="/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Create_Database-e1440412525937.png 650w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Create_Database-e1440412525937-300x207.png 300w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Create_Database-e1440412525937-160x110.png 160w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Create_Database-e1440412525937-400x276.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10201" class="wp-caption-text">CRUD_in_MVC_Using_Web_API_Create_Database</p></div>
<p>Once you created the database, you can see your database in App_Data folder.</p>
<div id="attachment_10211" style="width: 345px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Created_DB.png"><img decoding="async" aria-describedby="caption-attachment-10211" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Created_DB.png" alt="CRUD_in_MVC_Using_Web_API_Created_DB" width="335" height="135" class="size-full wp-image-10211" srcset="/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Created_DB.png 335w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Created_DB-300x121.png 300w" sizes="(max-width: 335px) 100vw, 335px" /></a><p id="caption-attachment-10211" class="wp-caption-text">CRUD_in_MVC_Using_Web_API_Created_DB</p></div>
<p>Now will add a new table to our database.</p>
<div id="attachment_10221" style="width: 357px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Adding_Table.png"><img decoding="async" aria-describedby="caption-attachment-10221" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Adding_Table.png" alt="CRUD_in_MVC_Using_Web_API_Adding_Table" width="347" height="294" class="size-full wp-image-10221" srcset="/wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Adding_Table.png 347w, /wp-content/uploads/2015/08/CRUD_in_MVC_Using_Web_API_Adding_Table-300x254.png 300w" sizes="(max-width: 347px) 100vw, 347px" /></a><p id="caption-attachment-10221" class="wp-caption-text">CRUD_in_MVC_Using_Web_API_Adding_Table</p></div>
<p>You can see the query to create a table below. </p>
<p>[sql]<br />
CREATE TABLE [dbo].[Table]<br />
(<br />
	[SubscriberID] INT NOT NULL PRIMARY KEY,<br />
    [MailID] NVARCHAR(50) NOT NULL,<br />
    [SubscribedDate] DATETIME2 NOT NULL<br />
)<br />
[/sql]</p>
<p>It seems our database is ready now. </p>
<div id="attachment_10868" style="width: 271px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API.png"><img decoding="async" aria-describedby="caption-attachment-10868" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API.png" alt="Load Data From Database Using Web API" width="261" height="293" class="size-full wp-image-10868" /></a><p id="caption-attachment-10868" class="wp-caption-text">Load Data From Database Using Web API</p></div>
<p>The next thing we need to do is to create a ADO.NET Entity Data Model. SO shall we do that? Right click on your model and click on add new item, in the upcoming dialogue, select ADO.NET Entity Data Model.Name that file, Here I have given the name as SP. And in the next steps select the tables, stored procedures, and views you want.</p>
<div id="attachment_10869" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-2.png"><img decoding="async" aria-describedby="caption-attachment-10869" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-2-1024x711.png" alt="Load Data From Database Using Web API " width="634" height="440" class="size-large wp-image-10869" srcset="/wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-2-1024x711.png 1024w, /wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-2-300x208.png 300w, /wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-2-768x533.png 768w, /wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-2-160x110.png 160w, /wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-2-400x278.png 400w, /wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-2-864x600.png 864w, /wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-2.png 1178w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-10869" class="wp-caption-text">Load Data From Database Using Web API</p></div>
<p>So a new file will be created in your model folder. </p>
<p>Now we will create an ajax call so that you can call the web API. We will use normal Ajax with type GET since we need to just retrieve the data.</p>
<blockquote><p> A web API control does not return any action result or any json result, so we need to manually do this. We will use the index.cshtml file as our view</p></blockquote>
<p>We are going to call our web API as follows from the view Index.cshtml.</p>
<p>[js]<br />
 @section scripts<br />
        {<br />
        &lt;script&gt;<br />
            $(document).ready(function () {<br />
                $.ajax(<br />
                    {<br />
                        type: &#8216;GET&#8217;,<br />
                        dataType: &#8216;json&#8217;,<br />
                        contentType: &#8216;application/json;charset=utf-8&#8217;,<br />
                        url: &#8216;http://localhost:3064/api/Subscribers&#8217;,<br />
                        success: function (data) {<br />
                            try {<br />
                                debugger;<br />
                                var html = &#8216;&lt;table&gt;&lt;thead&gt;&lt;th&gt;Mail ID&lt;/th&gt;&lt;th&gt;Subscription ID&lt;/th&gt;&lt;th&gt;Subscription Date&lt;/th&gt;&lt;/thead&gt;&lt;tbody&gt;&#8217;;<br />
                                $.each(data, function (key, val) {<br />
                                    debugger;<br />
                                    html += &#8216;&lt;tr&gt;&lt;td&gt;&#8217;<br />
                                        + &#8216;&lt;a &#8216; + &#8216;href=&quot;mailto:&#8217; + val.MailID + &#8216;&quot;&gt;&#8217; + val.MailID + &#8216;&lt;/a&gt;&#8217; +<br />
                                    &#8216;&lt;/td&gt;&lt;td&gt;&#8217; + val.SubscriberID + &#8216;&lt;/td&gt;&lt;td&gt;&#8217; + val.SubscribedDate + &#8216;&lt;/td&gt;&lt;/tr&gt;&#8217;;<br />
                                });<br />
                                html += &#8216;&lt;/tbody&gt;&lt;/table&gt;&#8217;;<br />
                                $(&#8216;#myGrid&#8217;).html(html);<br />
                            } catch (e) {<br />
                                console.log(&#8216;Error while formatting the data : &#8216; + e.message)<br />
                            }<br />
                        },<br />
                        error: function (xhrequest, error, thrownError) {<br />
                            console.log(&#8216;Error while ajax call: &#8216; + error)<br />
                        }</p>
<p>                    }<br />
                    );<br />
            });<br />
        &lt;/script&gt;</p>
<p>    }<br />
[/js]</p>
<p>Once we get the data in the success part of the ajax call we are formulating the data in an HTML table and bind the formatted html to the element myGrid. </p>
<p>[html]<br />
&lt;div id=&quot;myGrid&quot;&gt;&lt;/div&gt;<br />
[/html]</p>
<blockquote><p> Please be noted that url you give must be correct, or else you will end up with some errors. Your actions won&#8217;t work</p></blockquote>
<p>So we are calling our web api as http://localhost:3064/api/Subscribers. Do you remember we have already created a controller? Now we are going back to that. So we need to create an action which returns the total subscribed list from the database, so for that we will write few lines of codes as follows.</p>
<p>[csharp]<br />
public List&lt;tbl_Subscribers&gt; getSubscribers()<br />
        {<br />
            try<br />
            {<br />
                using (var db = new sibeeshpassionEntities())<br />
                {<br />
                    Subscriber sb = new Subscriber();<br />
                    return (sb.getSubcribers(db).ToList());<br />
                }</p>
<p>            }<br />
            catch (Exception)<br />
            {</p>
<p>                throw;<br />
            }<br />
        }<br />
[/csharp]</p>
<p>Here Subscriber is our model class, to get the reference of your model class in controller, you need to include the model namespace. We are getting a list of data in tbl_Subcribers type. Now we will concentrate on model class. </p>
<p>You can see the model action codes here.</p>
<p>[csharp]<br />
 public List&lt;tbl_Subscribers&gt; getSubcribers(sibeeshpassionEntities sb)<br />
        {<br />
            try<br />
            {<br />
                if (sb != null)<br />
                {<br />
                    return sb.tbl_Subscribers.ToList();<br />
                }<br />
                return null;<br />
            }<br />
            catch (Exception)<br />
            {<br />
                throw;<br />
            }<br />
        }<br />
[/csharp]</p>
<p>This will return the data which is available in the table tbl_Subcribers in sibeeshpassion DB. It seems everything is set. Now what else we need to do? Yes we need to create some entries in the table. Please see the insertion query here.</p>
<p>[sql]<br />
INSERT INTO [dbo].[tbl_Subscribers] ([SubscriberID], [MailID], [SubscribedDate]) VALUES (1, N&#8217;sibikv4u@gmail.com&#8217;, N&#8217;2015-10-30 00:00:00&#8242;)<br />
INSERT INTO [dbo].[tbl_Subscribers] ([SubscriberID], [MailID], [SubscribedDate]) VALUES (2, N&#8217;sibeesh.venu@gmail.com&#8217;, N&#8217;2015-10-29 00:00:00&#8242;)<br />
INSERT INTO [dbo].[tbl_Subscribers] ([SubscriberID], [MailID], [SubscribedDate]) VALUES (3, N&#8217;ajaybhasy@gmail.com&#8217;, N&#8217;2015-10-28 00:00:00&#8242;)<br />
[/sql]</p>
<p>So the data is inserted. Isn&#8217;t it?</p>
<div id="attachment_10870" style="width: 527px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-3.png"><img decoding="async" aria-describedby="caption-attachment-10870" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-3.png" alt="Load Data From Database Using Web API " width="517" height="200" class="size-full wp-image-10870" srcset="/wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-3.png 517w, /wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-3-300x116.png 300w, /wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-3-400x155.png 400w" sizes="(max-width: 517px) 100vw, 517px" /></a><p id="caption-attachment-10870" class="wp-caption-text">Load Data From Database Using Web API</p></div>
<blockquote><p><strong>Do you know?</strong><br />
Like we have RouteConfig.cs in MVC, we have another class file called WebApiConfig.cs in Web API which actually sets the routes.</p>
<p>[csharp]<br />
routes.MapRoute(<br />
                name: &quot;Default&quot;,<br />
                url: &quot;{controller}/{action}/{id}&quot;,<br />
                defaults: new { controller = &quot;Home&quot;, action = &quot;Index&quot;, id = UrlParameter.Optional }<br />
            );<br />
[/csharp]
</p></blockquote>
<p>So shall we run our project and see the output? Before going to run, I suggest you to style the HTML table by applying some CSSs as follows.</p>
<p>[css]<br />
&lt;style&gt;<br />
        table,tr,td,th {<br />
            border:1px solid #ccc;<br />
            border-radius:5px;<br />
            padding:10px;<br />
            margin:10px;<br />
        }</p>
<p>    &lt;/style&gt;<br />
[/css]</p>
<p>If everything goes fine, you will get the output as follows.</p>
<div id="attachment_10871" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-4-e1446288898428.png"><img decoding="async" aria-describedby="caption-attachment-10871" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-4-e1446288898428.png" alt="Load Data From Database Using Web API" width="650" height="497" class="size-full wp-image-10871" srcset="/wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-4-e1446288898428.png 650w, /wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-4-e1446288898428-300x229.png 300w, /wp-content/uploads/2015/10/Load-Data-From-Database-Using-Web-API-4-e1446288898428-400x306.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10871" class="wp-caption-text">Load Data From Database Using Web API</p></div>
<p>That is all. We did it. Have a happy coding.</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Did you try Web API yet? Have you ever wanted to do this requirement? 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’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/load-data-from-database-using-web-api/feed/</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
			</item>
	</channel>
</rss>
