<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4406100039163587256</id><updated>2024-11-08T07:34:25.388-08:00</updated><category term="C#"/><category term="C# Fundamentals"/><category term=".Net"/><category term="Microsoft Azure"/><category term="Infographics"/><category term="C# Brainteasers"/><category term="C# Specifications"/><category term="Asp.net"/><category term="Design Patterns"/><category term="CSharp"/><category term="Cloud Computing"/><category term="Dot Net"/><category term="Visual Studio 2015"/><category term="Web Services"/><category term="MVC"/><category term=".Net 4.5"/><category term="Azure"/><category term="Free Web Hosting"/><category term="Optimization"/><category term="Question of The Day"/><category term="Software Development"/><category term="Table Storage"/><category term="Utilities"/><category term="WCF"/><category term="Ajax"/><category term="Blog Storage"/><category term="Concat"/><category term="Extension Methods"/><category term="Format"/><category term="Fundamentals"/><category term="IIS"/><category term="JQuery"/><category term="Kubernetes"/><category term="LINQ"/><category term="Little Wonders"/><category term="Programming Languages"/><category term="SQL Server Management Studio"/><category term="Service Bus"/><category term="StringBuilder"/><category term="Visual Studio"/><category term="foreach"/><category term="string"/><title type='text'>Dot Net Deewane</title><subtitle type='html'>(Helping you out with C#, ASP.NET, SQL, Microsoft Azure, MVC &amp;amp; Javascript)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>150</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-1171355749859009718</id><published>2022-01-25T08:26:00.006-08:00</published><updated>2022-01-25T09:45:06.502-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>What are &#39;closures&#39; in .NET?</title><content type='html'>In essence, a closure is a block of code that can be executed at a later time, but which maintains the environment in which it was first created - i.e. it can still use the local variables, etc of the method which created it, even after that method has finished executing.&lt;br /&gt;&lt;br /&gt;The general feature of closures is implemented in C# by anonymous methods and lambda expressions.&lt;br /&gt;&lt;br /&gt;Here&#39;s an example using an anonymous method:&lt;br /&gt;&lt;br /&gt;using System;&lt;div&gt;&lt;br /&gt;class Test&lt;br /&gt;{&lt;br /&gt;    &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;static void Main()&lt;br /&gt;    &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;{&lt;br /&gt;        &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Action action = CreateAction();&lt;br /&gt;        &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;action();&lt;br /&gt;        &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;action();&lt;br /&gt;    &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;    &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;static Action CreateAction()&lt;br /&gt;    &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;{&lt;br /&gt;        &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;int counter = 0;&lt;br /&gt;        &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;return delegate&lt;br /&gt;        &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;{&lt;br /&gt;            &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;// Yes, it could be done in one statement;&lt;br /&gt;            &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;// but it is clearer like this.&lt;br /&gt;            &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;counter++;&lt;br /&gt;            &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Console.WriteLine(&quot;counter={0}&quot;, counter);&lt;br /&gt;        &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;};&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;counter=1&lt;br /&gt;counter=2&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Here we can see that the action returned by CreateAction still has access to the counter variable, and can indeed increment it, even though CreateAction itself has finished.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/1171355749859009718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2022/01/what-are-closures-in-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/1171355749859009718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/1171355749859009718'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2022/01/what-are-closures-in-net.html' title='What are &#39;closures&#39; in .NET?'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-8190353135585246266</id><published>2021-11-21T06:40:00.007-08:00</published><updated>2021-11-21T06:40:49.834-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kubernetes"/><title type='text'>Basics of Kubernetes </title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;font-family: inherit;&quot;&gt;Kubernetes is an open-source container orchestration framework, it was developed by Google. Kubernetes manages containers it could be a docker container or any other container technology. So we can say that Kubernetes help us manage the containerized application, We can use Kubernetes on a different type of environments let it be a physical server, virtual machines or cloud.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;What Problem Does It Solve&lt;/strong&gt;: The rise of microservice architecture has increased the use of container technologies. nowadays a complex enterprise application can have thousands of containers. managing those containers using scripts or self-made tools is very tough and error-prone. Kubernetes like container orchestration tools solve this problem.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;A container orchestration tool offers the following features&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;High Availability or no downtime&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Scalability or high performance&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Disaster recovery&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;Basic Architectures:&lt;/strong&gt;&amp;nbsp;Kubernetes cluster is made of at least one master node and connected to it a couple of&amp;nbsp;&lt;strong&gt;worker nodes&lt;/strong&gt;. These worker nodes have a process running on them which is known as kubelet (primary node agent). kubelet makes it possible for these worker nodes to talk to each other, also it executes tasks needed to keep the cluster running. these worker nodes can have one of the multiple containers running on them.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;Master nodes&lt;/strong&gt;&amp;nbsp;run several important Kubernetes processes which are necessary to run and manage Kubernetes clusters properly, one of the processes is the API server, it&#39;s a container that is an entry point for the K8S cluster. If you are using UI, API, or CLI to manage the cluster it interacts with this API service. Another Important service running on master is controller manager, it keeps a track of what is happening in the cluster. whether something needs to be repaired or a container died and needs to be restarted. Another important service is scheduled, it&#39;s responsible for the creation of the pods on the nodes, scheduler keeps track of the resources on different worker nodes, and based on the need it decides on which nodes the next pod should be created. Another important component of the Kubernetes cluster that runs on the master nodes is etcd storage, its key-value pair which stores the current state of the cluster. it users to restore the cluster based on the need.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Another important part of Kubernetes is the&amp;nbsp;&lt;strong&gt;virtual network&lt;/strong&gt;, which converts the whole cluster into a single unified powerful machine.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;We can see that the actual application will be deployed on worker nodes, which means most of the work will be done by worker nodes, and due to that, these worker nodes will be the bigger machine. where master nodes just run a handful of services, but the master is very important for the proper functioning of the whole cluster so if the master is down we will not be able to access the cluster due to that there could be multiple master nodes as in production environment so that when one master node is done cluster can still work smoothly as we have other master nodes available.&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiQpZfbNGzFPY0zhp3gb_Q9qU4iRwYcTtSu-6Yk6qQpceGuOwmxBKS7GYJbdmB9dXOKTDERXbZa1w4WH-1zKvnHPm6GJGl1weS4pX1APtcEGM-5nMOD5RRnDNBzCyKxp7sGh4_Csxn1qRc0CImCnODlnPbHY6olncZlwIVY-6DBSDyAgf7czMlnjhpbtA=s1521&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1053&quot; data-original-width=&quot;1521&quot; height=&quot;278&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiQpZfbNGzFPY0zhp3gb_Q9qU4iRwYcTtSu-6Yk6qQpceGuOwmxBKS7GYJbdmB9dXOKTDERXbZa1w4WH-1zKvnHPm6GJGl1weS4pX1APtcEGM-5nMOD5RRnDNBzCyKxp7sGh4_Csxn1qRc0CImCnODlnPbHY6olncZlwIVY-6DBSDyAgf7czMlnjhpbtA=w400-h278&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;strong style=&quot;font-family: inherit;&quot;&gt;Basic Concepts&lt;/strong&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;: let us understand a few basic but important Kubernetes concepts, pods, and containers. The pod is the smallest unit which as a Kubernetes user you will/can configure. The pod is a wrapper on the container. in a pod, you can have one or more containers. Usually, per application, you will have one pod, for example, the database could need one pod, UI could need another Pod, API could need another Pod, So if your application needs only one container then the Pod will have a single container in it. or if the application needs multiple containers then Pod will have multiple containers.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Each pod is a self-contained server with its own IP address. the way they communicate with each other with the help of these IPs. We do not configure or create containers directly in the Kubernetes cluster. We work with Pods. Pod manages the container running inside itself. So if a container dies within a Pod then Pod restarts that container automatically. Pods are themselves ephemeral components that mean pods can also die very frequently and when a pod dies a new one gets created, here is where the notion of services comes into play so when a pod gets restarted or recreated a new pod is created with a new IP address, so if you were running a database on a Pod and using that Pod&#39;s IP address to connect to this database if the pod restarted the IP will change and other pods where the applications are deployed will not be able to connect to that database. This is very inconvenient to use the IP address to access the Pod. This is where another component of Kubernetes called service is used, which is basically and substitute for those IPs. Service is basically a component seat in front of each Pod that talks to each other. so if a Pod behind the service dies and gets recreated the service stays in place. as the service life cycle is not tied to Pod.&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj_5oqqVCahndkqpY3Y8KCEcPBC2lRuF3eeqyCh3q0Pd7xcYSoZ6oPe0S2Fueo_dGXzl0lXaexJrMXVW-g5H498R-x2-ICZqiimyNRKcKTC-ml1sE9HmrNsaw8dAyhyU19depT9QULYmH-bSav_YJnR7wFYnQDX8ZEaVxUzVa9rrZW1YPby3PFiRcDk6g=s1020&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;954&quot; data-original-width=&quot;1020&quot; height=&quot;374&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEj_5oqqVCahndkqpY3Y8KCEcPBC2lRuF3eeqyCh3q0Pd7xcYSoZ6oPe0S2Fueo_dGXzl0lXaexJrMXVW-g5H498R-x2-ICZqiimyNRKcKTC-ml1sE9HmrNsaw8dAyhyU19depT9QULYmH-bSav_YJnR7wFYnQDX8ZEaVxUzVa9rrZW1YPby3PFiRcDk6g=w400-h374&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Service has to main functionality one is IP address means it has a permanent IP address which can be used to communicate between the pods and at the same time its a load balancer&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjmqYEuqmrd0M5gXNuM5yeC3PzlTA-O2lYN-ln-dr6rtbM4CRUTCPmtTmiO2gvFS8myiCqsnxSUThAiinu8EwEkCrXYYgeHOrVmZuikU-nChQ3VKkWQG2Aed_goRXS1QN-VUNF91xn1FtSaDcBBg1bAMSCDUb_562755HDxhejItpd9NshtGGA8gP-euA=s1035&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;951&quot; data-original-width=&quot;1035&quot; height=&quot;368&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjmqYEuqmrd0M5gXNuM5yeC3PzlTA-O2lYN-ln-dr6rtbM4CRUTCPmtTmiO2gvFS8myiCqsnxSUThAiinu8EwEkCrXYYgeHOrVmZuikU-nChQ3VKkWQG2Aed_goRXS1QN-VUNF91xn1FtSaDcBBg1bAMSCDUb_562755HDxhejItpd9NshtGGA8gP-euA=w400-h368&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;Example Configurations:&lt;/strong&gt;&amp;nbsp;Let us now see how we can configure different Kubernetes components. All the configurations in the Kubernetes go through the master node with the process called API server. Kubernetes client which could be UI (Kubernetes dashboard) or an API which could be a script or CLI, all talk to API server and they send their configuration request to the API server in the form of JSON or XAML format, In the request, we send a deployment which is nothing but a template to create a Pod.&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhBaWY__LRBBabM2yKCXx7_S5JtYLNCwKav0Ui1OiNzsZoXibI6IWOPZtzU9LtPz_2UTzbY_8NWUxmNkCnRSK-dxiLss4y5CNaq_bbkx_cVEvMfFgZ17yMxrhhRpyBmJ69U0xSAgbnDYbvpPAcr7HRu3sPGkSzpEFndLf2is2PmacRY6LaWJ6BB6z_Trg=s1618&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;986&quot; data-original-width=&quot;1618&quot; height=&quot;244&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhBaWY__LRBBabM2yKCXx7_S5JtYLNCwKav0Ui1OiNzsZoXibI6IWOPZtzU9LtPz_2UTzbY_8NWUxmNkCnRSK-dxiLss4y5CNaq_bbkx_cVEvMfFgZ17yMxrhhRpyBmJ69U0xSAgbnDYbvpPAcr7HRu3sPGkSzpEFndLf2is2PmacRY6LaWJ6BB6z_Trg=w400-h244&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;in the example above we are asking Kubernetes to create two pods with the app name my-app which will be based on the containers images my-images. also, we are passing the environment variable.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;This configuration is declarative in nature and using these configurations we are telling Kubernetes that what is the desired state. So Kubernetes master controller component checks that state of the cluster and if it does not match with the configuration then creates the pods to meet the desired state.&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/8190353135585246266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2021/11/basics-of-kubernetes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/8190353135585246266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/8190353135585246266'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2021/11/basics-of-kubernetes.html' title='Basics of Kubernetes '/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEiQpZfbNGzFPY0zhp3gb_Q9qU4iRwYcTtSu-6Yk6qQpceGuOwmxBKS7GYJbdmB9dXOKTDERXbZa1w4WH-1zKvnHPm6GJGl1weS4pX1APtcEGM-5nMOD5RRnDNBzCyKxp7sGh4_Csxn1qRc0CImCnODlnPbHY6olncZlwIVY-6DBSDyAgf7czMlnjhpbtA=s72-w400-h278-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-54746594412870120</id><published>2018-07-29T08:16:00.003-07:00</published><updated>2018-07-29T08:16:49.369-07:00</updated><title type='text'>The 10 Most Common Mistakes That C# Developers Make</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7VnF9VXhnzcNH0wN-vVUXHAnxN_rE7NVEeprh-11KopQ_BeTQJESQ3wIAIV0Dux7JUjyOfgN_QW8NCrrUWRdCTcG4iYbEJFCFK71XERCVzO7wmKoHuI48_1zRN_lxL5rQ2JU63kdIaDgd/s1600/pixemweb-cover-art-wp.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;429&quot; data-original-width=&quot;1600&quot; height=&quot;171&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7VnF9VXhnzcNH0wN-vVUXHAnxN_rE7NVEeprh-11KopQ_BeTQJESQ3wIAIV0Dux7JUjyOfgN_QW8NCrrUWRdCTcG4iYbEJFCFK71XERCVzO7wmKoHuI48_1zRN_lxL5rQ2JU63kdIaDgd/s640/pixemweb-cover-art-wp.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
C# is an object oriented, strongly-typed language. The strict type checking in C#, both at compile and run times, results in the majority of typical programming errors being reported as early as possible, and their locations pinpointed quite accurately. This can save the C# programmer a lot of time, compared to tracking down the cause of puzzling errors which can occur long after the offending operation takes place in languages which are more liberal with their enforcement of type safety. &amp;nbsp;However, a lot of programmers unwittingly (or carelessly) throw away the benefits of this detection, which leads to some of the issues discussed in this post.&lt;span id=&quot;more-29&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-1-using-a-reference-like-a-value-or-vice-versa&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #1: Using a reference like a value or vice versa&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Programmers of C++, and many other languages, are accustomed to being in control of whether the values they assign to variables are simply values or are references to existing objects.&amp;nbsp;In C#, however, that decision is made by the programmer who wrote&amp;nbsp;the object, not by the programmer who instantiates the object and assigns it to a variable. &amp;nbsp;This is a common “gotcha” for newbie C# programmers.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If you don’t know whether the object you’re using is a value type or reference type, you could run into some surprises. For example:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; Point point1 = new Point(20, 30);
  Point point2 = point1;
  point2.X = 50;
  Console.WriteLine(point1.X); &amp;nbsp; &amp;nbsp; &amp;nbsp; // 20 (does this surprise you?)
  Console.WriteLine(point2.X); &amp;nbsp; &amp;nbsp; &amp;nbsp; // 50
  
  Pen pen1 = new Pen(Color.Black);
  Pen pen2 = pen1;
  pen2.Color = Color.Blue;
  Console.WriteLine(pen1.Color); &amp;nbsp; &amp;nbsp; // Blue (or does this surprise you?)
  Console.WriteLine(pen2.Color); &amp;nbsp; &amp;nbsp; // Blue
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
As you can see, both the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Point&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Pen&lt;/code&gt;&amp;nbsp;objects were created the exact same way, but the value of&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;point1&lt;/code&gt;&amp;nbsp;remained unchanged when a new&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;X&lt;/code&gt;&amp;nbsp;coordinate value was assigned to&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;point2&lt;/code&gt;, whereas the value of&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;pen1&lt;/code&gt;&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;was&lt;/em&gt;&amp;nbsp;modified when a new color was assigned to&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;pen2&lt;/code&gt;. We can therefore&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;deduce&lt;/em&gt;&amp;nbsp;that&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;point1&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;point2&lt;/code&gt;&amp;nbsp;each contain their own copy of a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Point&lt;/code&gt;&amp;nbsp;object, whereas&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;pen1&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;pen2&lt;/code&gt;&amp;nbsp;contain references to the same&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Pen&lt;/code&gt;&amp;nbsp;object.&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;But how can we know that without doing this experiment?&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The answer is to look at the definitions of the object types (which you can easily do in Visual Studio by placing your cursor over the name of the object type and pressing F12):&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  public struct Point { … }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// defines a “value” type
  public class Pen { … }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// defines a “reference” type
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
As shown above, in C#, the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;struct&lt;/code&gt;&amp;nbsp;keyword is used to define a value type, while the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/code&gt;&amp;nbsp;keyword is used to define a reference type.&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;For those with a C++ background, who were lulled into a false sense of security by the many similarities between C++ and C# keywords, this behavior likely comes as a surprise that may have you asking for help from a C# tutorial.&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If you’re going to depend on some behavior which differs between value and reference types – such as the ability to pass an object as a method parameter and have that method change the state of the object – make sure that you’re dealing with the correct type of object to avoid C# problems.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-2-misunderstanding-default-values-for-uninitialized-variables&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #2: Misunderstanding default values for uninitialized variables&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In C#, value types can’t be null. By definition, value types have a value, and even uninitialized variables of value types must have a value. This is called the default value for that type. &amp;nbsp;This leads to the following, usually unexpected result when checking if a variable is uninitialized:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  class Program {
      static Point point1;
      static Pen pen1;
      static void Main(string[] args) {
          Console.WriteLine(pen1 == null); &amp;nbsp; &amp;nbsp; &amp;nbsp;// True
          Console.WriteLine(point1 == null); &amp;nbsp; &amp;nbsp;// False (huh?)
      }
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Why isn’t&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;point1&lt;/code&gt;&amp;nbsp;null? The answer is that&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Point&lt;/code&gt;&amp;nbsp;is a value type, and the default value for a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Point&lt;/code&gt;&amp;nbsp;is (0,0), not&amp;nbsp;null. Failure to recognize this is a very easy (and common) mistake to make in C#.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Many (but not all) value types have an&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IsEmpty&lt;/code&gt;&amp;nbsp;property which you can check to see if it is equal to its default value:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  Console.WriteLine(point1.IsEmpty);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// True
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
When you’re checking to see if a variable has been initialized or not, make sure you know what value an uninitialized variable of that type will have by default and don’t rely on it being null..&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-3-using-improper-or-unspecified-string-comparison-methods&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #3: Using improper or unspecified string comparison methods&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
There are many different ways to compare strings in C#.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Although many programmers use the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/code&gt;&amp;nbsp;operator for string comparison, it is actually one of the&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;least&lt;/em&gt;desirable methods to employ, primarily because it doesn’t specify explicitly in the code which type of comparison is wanted.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Rather, the preferred way to test for string equality in C# is with the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Equals&lt;/code&gt;&amp;nbsp;method:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  public bool Equals(string value);
  public bool Equals(string value, StringComparison comparisonType);
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The first method signature (i.e., without the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;comparisonType&lt;/code&gt;&amp;nbsp;parameter), is actually the same as using the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/code&gt;&amp;nbsp;operator, but has the benefit of being explicitly applied to strings. It performs an ordinal comparison of the strings, which is basically a byte-by-byte comparison. In many cases this is exactly the type of comparison you want, especially when comparing strings whose values are set programmatically, such as file names, environment variables, attributes, etc. In these cases, as long as an ordinal comparison is indeed the correct type of comparison for that situation, the only downside to using the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Equals&lt;/code&gt;&amp;nbsp;method without a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;comparisonType&lt;/code&gt;&amp;nbsp;is that somebody reading the code may not know what type of comparison you’re making.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Using the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Equals&lt;/code&gt;&amp;nbsp;method signature that includes a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;comparisonType&lt;/code&gt;&amp;nbsp;every time you compare strings, though, will not only make your code clearer, it will make you explicitly think about which type of comparison you need to make. This is a worthwhile thing to do, because even if English may not provide a whole lot of differences between ordinal and culture-sensitive comparisons, other languages provide plenty, and ignoring the possibility of other languages is opening yourself up to a lot of potential for errors down the road. &amp;nbsp;For example:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  string s = &quot;strasse&quot;;
  
  // outputs False:
  Console.WriteLine(s == &quot;straße&quot;);
  Console.WriteLine(s.Equals(&quot;straße&quot;));
  Console.WriteLine(s.Equals(&quot;straße&quot;, StringComparison.Ordinal));
  Console.WriteLine(s.Equals(&quot;Straße&quot;, StringComparison.CurrentCulture));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  Console.WriteLine(s.Equals(&quot;straße&quot;, StringComparison.OrdinalIgnoreCase));
  
  // outputs True:
  Console.WriteLine(s.Equals(&quot;straße&quot;, StringComparison.CurrentCulture));
  Console.WriteLine(s.Equals(&quot;Straße&quot;, StringComparison.CurrentCultureIgnoreCase));
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The safest practice is to always provide a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;comparisonType&lt;/code&gt;&amp;nbsp;parameter to the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Equals&lt;/code&gt;&amp;nbsp;method. Here are some basic guidelines:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;When comparing strings that were input by the user, or are to be displayed to the user, use a culture-sensitive comparison (&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CurrentCulture&lt;/code&gt;&amp;nbsp;or&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CurrentCultureIgnoreCase&lt;/code&gt;).&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;When comparing programmatic strings, use ordinal comparison (&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Ordinal&lt;/code&gt;&amp;nbsp;or&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;OrdinalIgnoreCase&lt;/code&gt;).&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;InvariantCulture&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;InvariantCultureIgnoreCase&lt;/code&gt;&amp;nbsp;are generally not to be used except in very limited circumstances, because ordinal comparisons are more efficient. &amp;nbsp;If a culture-aware comparison is necessary, it should usually be performed against the current culture or another specific culture.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In addition to the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Equals&lt;/code&gt;&amp;nbsp;method, strings also provide the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Compare&lt;/code&gt;&amp;nbsp;method, which gives you information about the relative order of strings instead of just a test for equality. This method is preferable to the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;=&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;gt;&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;gt;=&lt;/code&gt;&amp;nbsp;operators, for the same reasons as discussed above–to avoid C# problems.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-4-using-iterative-instead-of-declarative-statements-to-manipulate-collections&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #4: Using iterative (instead of declarative) statements to manipulate collections&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In C# 3.0, the addition of Language-Integrated Query&amp;nbsp;(LINQ) to the language changed forever the way collections are queried and manipulated. &amp;nbsp;Since then, if you’re using iterative statements to manipulate collections, you didn’t use LINQ when you probably should have.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Some C# programmers don’t even know of LINQ’s existence, but fortunately that number is becoming increasingly small. Many still think, though, that because of the similarity between LINQ keywords and SQL statements, its only use is in code that queries databases.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
While database querying is&amp;nbsp;a very prevalent use of LINQ statements, they actually work over any enumerable collection (i.e., any object that implements the IEnumerable&amp;nbsp;interface). &amp;nbsp;So for example, if you had an array of Accounts, instead of writing:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  decimal total = 0;
  foreach (Account account in myAccounts) {
    if (account.Status == &quot;active&quot;) {
      total += account.Balance;
    }
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
you could just write:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  decimal total = (from account in myAccounts
                   where account.Status == &quot;active&quot;
                   select account.Balance).Sum();
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
While this is a pretty simple example of how to avoid this common C# programming problem, there are cases where a single LINQ statement can easily replace dozens of statements in an iterative loop (or nested loops) in your code. &amp;nbsp;And less code general means less opportunities for bugs to be introduced.&amp;nbsp;Keep in mind, however, there may be a trade-off in terms of performance. In performance-critical scenarios, especially where your iterative code is able to make assumptions about your collection that LINQ cannot, be sure to do a performance comparison between the two methods.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-5-failing-to-consider-the-underlying-objects-in-a-linq-statement&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #5: Failing to consider the underlying objects in a LINQ statement&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
LINQ is great for abstracting the task of manipulating collections, whether they are in-memory objects, database tables, or XML documents. &amp;nbsp;In a perfect world, you wouldn’t need to know what the underlying objects are. But the error here is assuming we live in a perfect world. &amp;nbsp;In fact, identical LINQ statements can return different results when executed on the exact same data, if that data happens to be in a different format.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
For instance, consider the following statement:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  decimal total = (from account in myAccounts
                   where account.Status == &quot;active&quot;
                   select account.Balance).Sum();
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
What happens if one of the object’s&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;account.Status&lt;/code&gt;&amp;nbsp;equals “Active” (note the capital A)? &amp;nbsp;Well, if&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;myAccounts&lt;/code&gt;&amp;nbsp;was a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;DbSet&lt;/code&gt;&amp;nbsp;object (that was set up with the default case-insensitive configuration), the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;where&lt;/code&gt;&amp;nbsp;expression would still match that element. &amp;nbsp;However, if&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;myAccounts&lt;/code&gt;&amp;nbsp;was in an in-memory array, it would not match, and would therefore yield a different result for total.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
But wait a minute. &amp;nbsp;When we talked about string comparison earlier, we saw that the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/code&gt;&amp;nbsp;operator performed an ordinal comparison of strings. So why in this case is the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/code&gt;&amp;nbsp;operator performing a case-insensitive comparison?&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;The answer is that when the underlying objects in a LINQ statement are references to SQL table data (as is the case with the Entity Framework DbSet&amp;nbsp;object in this example), the statement is converted into a T-SQL statement. Operators then follow T-SQL rules, not C# rules, so the comparison in the above case ends up being case insensitive.&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In general, even though LINQ is a helpful and consistent way to query collections of objects, in reality you still need to know whether or not your statement will be translated to something other than C# under the hood to ensure that the behavior of your code will be as expected at runtime.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-6-getting-confused-or-faked-out-by-extension-methods&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #6: Getting confused or faked out by extension methods&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
As mentioned earlier, LINQ statements work on any object that implements IEnumerable. For example, the following simple function will add up the balances on any collection of accounts:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  public decimal SumAccounts(IEnumerable&amp;lt;Account&amp;gt; myAccounts) {
      return myAccounts.Sum(a =&amp;gt; a.Balance);
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In the above code, the type of the myAccounts&amp;nbsp;parameter is declared as&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IEnumerable&amp;lt;Account&amp;gt;&lt;/code&gt;. &amp;nbsp;Since&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;myAccounts&lt;/code&gt;&amp;nbsp;references a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sum&lt;/code&gt;&amp;nbsp;method (C# uses the familiar “dot notation” to reference a method on a class or interface), we’d expect to see a method called&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sum()&lt;/code&gt;&amp;nbsp;on the definition of the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt;interface. &amp;nbsp;However, the definition of&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt;, makes no reference to any&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sum&lt;/code&gt;&amp;nbsp;method and simply looks like this:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  public interface IEnumerable&amp;lt;out T&amp;gt; : IEnumerable {
      IEnumerator&amp;lt;T&amp;gt; GetEnumerator();
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
So where is the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sum()&lt;/code&gt;&amp;nbsp;method defined? C# is strongly typed, so if the reference to the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sum&lt;/code&gt;&amp;nbsp;method was invalid, the C# compiler would certainly flag it as an error. &amp;nbsp;We therefore know that it must exist, but where? &amp;nbsp;Moreover, where are the definitions of all the other methods that LINQ provides for querying or aggregating these collections?&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The answer is that&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sum()&lt;/code&gt;&amp;nbsp;is not a method defined on the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IEnumerable&lt;/code&gt;&amp;nbsp;interface. Rather, it is a static method (called an “extension method”) that is defined on the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;System.Linq.Enumerable&lt;/code&gt;&amp;nbsp;class:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  namespace System.Linq {
    public static class Enumerable {
      ...
      // the reference here to “this IEnumerable&amp;lt;TSource&amp;gt; source” is
      // the magic sauce that provides access to the extension method Sum
      public static decimal Sum&amp;lt;TSource&amp;gt;(this IEnumerable&amp;lt;TSource&amp;gt; source,
                                         Func&amp;lt;TSource, decimal&amp;gt; selector);
      ...
    }
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
So what makes an extension method different from any other static method and what enables us to access it in other classes?&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The distinguishing characteristic of an extension method is the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;this&lt;/code&gt;&amp;nbsp;modifier on its first parameter. This is the “magic” that identifies it to the compiler as an extension method.&amp;nbsp;The type of the parameter it modifies (in this case&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IEnumerable&amp;lt;TSource&amp;gt;&lt;/code&gt;) denotes the class or interface which will then appear to implement this method.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
(As a side point, there’s nothing magical about the similarity between the name of the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IEnumerable&lt;/code&gt;&amp;nbsp;interface and the name of the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Enumerable&lt;/code&gt;&amp;nbsp;class on which the extension method is defined. This similarity is just an arbitrary stylistic choice.)&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
With this understanding, we can also see that the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;sumAccounts&lt;/code&gt;&amp;nbsp;function we introduced above could instead have been implemented as follows:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  public decimal SumAccounts(IEnumerable&amp;lt;Account&amp;gt; myAccounts) {
      return Enumerable.Sum(myAccounts, a =&amp;gt; a.Balance);
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The fact that we could have implemented it this way instead raises the question of why have extension methods at all? &amp;nbsp;Extension methods&amp;nbsp;are essentially a convenience of the C# language that enables you to “add” methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Extension methods are brought into scope by including a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;using [namespace];&lt;/code&gt;&amp;nbsp;statement at the top of the file.&amp;nbsp;You need to know which namespace includes the extension methods you’re looking for, but that’s pretty easy to determine once you know what it is you’re searching for.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
When the C# compiler encounters a method call on an instance of an object, and doesn’t find that method defined on the referenced object class, it then looks at all extension methods that are within scope to try to find one which matches the required method signature and class.&amp;nbsp;If it finds one, it will pass the instance reference as the first argument to that extension method, then the rest of the &amp;nbsp;arguments, if any, will be passed as subsequent arguments to the extension method. &amp;nbsp;(If the C# compiler doesn’t find any corresponding extension method within scope, it will throw an error.)&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Extension methods are an example of “syntactic sugar” on the part of the C# compiler, which allows us to write code that is (usually) clearer and more maintainable. &amp;nbsp;Clearer, that is, if you’re aware of their usage. Otherwise, it can be a bit confusing, especially at first.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
While there certainly are advantages to using extension methods, they can cause problems and a cry for C# help for those developers who aren’t aware of them or don’t properly understand them. This is especially true when looking at code samples online, or at any other pre-written code. When such code &amp;nbsp;produces compiler errors (because it invokes methods that clearly aren’t defined on the classes they’re invoked on), the tendency is to think the code applies to a different version of the library, or to a different library altogether. A lot of time can be spent searching for a new version, or phantom “missing library”, that doesn’t exist.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Even developers who are familiar with extension methods still get caught occasionally, when there is a method with the same name on the object, but its method signature differs in a subtle way from that of the extension method. A lot of time can be wasted looking for a typo or error that just isn’t there.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Use of extension methods in C# libraries is becoming increasingly prevalent. &amp;nbsp;In addition to LINQ, the Unity Application Block&amp;nbsp;and the Web API framework&amp;nbsp;are examples of&amp;nbsp;two heavily-used modern libraries by Microsoft which make use of extension methods as well, and there are many others. The more modern the framework, the more likely it is that it will incorporate extension methods.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Of course, you can write your own extension methods as well. Realize, however, that while extension methods appear to get invoked just like regular instance methods, this is really just an illusion. &amp;nbsp;In particular, your extension methods can’t reference private or protected members of the class they’re extending and therefore cannot serve as a complete replacement for more traditional class inheritance.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-7-using-the-wrong-type-of-collection-for-the-task-at-hand&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #7: Using the wrong type of collection for the task at hand&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
C# provides a large variety of collection objects, with the following being only a partial list:&lt;br /&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Array&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ArrayList&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;BitArray&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;BitVector32&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dictionary&amp;lt;K,V&amp;gt;&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;HashTable&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;HybridDictionary&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;List&amp;lt;T&amp;gt;&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;NameValueCollection&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;OrderedDictionary&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Queue, Queue&amp;lt;T&amp;gt;&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SortedList&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Stack, Stack&amp;lt;T&amp;gt;&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;StringCollection&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;StringDictionary&lt;/code&gt;.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
While there can be cases where too many choices is as bad as not enough choices, that isn’t the case with collection objects. The number of options available can definitely work to your advantage. &amp;nbsp;Take a little extra time upfront to research and choose the optimal collection type for your purpose. &amp;nbsp;It will likely result in better performance and less room for error.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If there’s a collection type specifically targeted at the type of element you have (such as string or bit) lean toward using that one first. The implementation is generally more efficient when it’s targeted to a specific type of element.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
To take advantage of the type safety of C#, you should usually prefer a generic interface over a non-generic one. The elements of a generic interface are of the type you specify when you declare your object, whereas the elements of non-generic interfaces are of type object.&amp;nbsp;When using a non-generic interface, the C# compiler can’t type-check your code. Also, when dealing with collections of primitive value types, using a non-generic collection will result in repeated boxing/unboxing&amp;nbsp;of those types, which can result in a significant negative performance impact when compared to a generic collection of the appropriate type.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Another common C# problem is to write your own collection object. That isn’t to say it’s never appropriate, but with as comprehensive a selection as the one .NET offers, you can probably save a lot of time by using or extending one that already exists, rather than reinventing the wheel. &amp;nbsp;In particular, the C5 Generic Collection Library&amp;nbsp;for C# and CLI offers a wide array of additional collections “out of the box”, such as persistent tree data structures, heap based priority queues, hash indexed array lists, linked lists, and much more.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-8-neglecting-to-free-resources&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #8: Neglecting to free resources&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The CLR environment employs a garbage collector, so you don’t need to explicitly free the memory created for any object. In fact, you can’t. There’s no equivalent of the C++&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;delete&lt;/code&gt;&amp;nbsp;operator&amp;nbsp;or the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;free()&lt;/code&gt;&amp;nbsp;function in C . But that doesn’t mean that you can just forget about all objects after you’re done using them. Many types of objects encapsulate some other type of system resource (e.g., a disk file, database connection, network socket, etc.). &amp;nbsp;Leaving these resources open can quickly deplete the total number of system resources, degrading performance and ultimately leading to program faults.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
While a destructor method can be defined on any C# class, the problem with destructors (also called finalizers in C#) is that you can’t know for sure when they will be called. They are called by the garbage collector (on a separate thread, which can cause additional complications) at an indeterminate time in the future. Trying to get around these limitations by forcing garbage collection with&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;GC.Collect()&lt;/code&gt;&amp;nbsp;is not a good practice, as that will block the thread for an unknown amount of time while it collects all objects eligible for collection.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
This&amp;nbsp;is not to say there are no good uses for finalizers, but freeing resources in a deterministic way isn’t one of them. Rather, when you’re operating on a file, network or database connection, you want to explicitly free the underlying resource as soon as you are done with it.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Resource leaks are a concern in almost any environment. However, C# provides a mechanism that is robust and simple to use which, if utilized, can make leaks a much rarer occurrence. The .NET framework defines the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IDisposable&lt;/code&gt;&amp;nbsp;interface, which consists solely of the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dispose()&lt;/code&gt;&amp;nbsp;method. Any object which implements&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IDisposable&lt;/code&gt;&amp;nbsp;expects to have that method called whenever the consumer of the object is finished manipulating it. This results in explicit, deterministic freeing of resources.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If you are creating and disposing of an object within the context of a single code block, it is basically inexcusable to forget to call&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dispose()&lt;/code&gt;, because C# provides a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;using&lt;/code&gt;&amp;nbsp;statement that will ensure&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dispose()&lt;/code&gt;&amp;nbsp;gets called no matter how the code block is exited (whether it be an exception, a return statement, or simply the closing of the block). And yes, that’s the same&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;using&lt;/code&gt;&amp;nbsp;statement mentioned previously that is used to include namespaces at the top of your file. It has a second, completely unrelated purpose, which many C# developers are unaware of; namely, to ensure that&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dispose()&lt;/code&gt;&amp;nbsp;gets called on an object when the code block is exited:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  using (FileStream myFile = File.OpenRead(&quot;foo.txt&quot;)) {
    myFile.Read(buffer, 0, 100);
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
By creating a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;using&amp;nbsp;&lt;/code&gt;block in the above example, you know for sure that&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;myFile.Dispose()&lt;/code&gt;&amp;nbsp;will be called as soon as you’re done with the file, whether or not&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Read()&lt;/code&gt;&amp;nbsp;throws an exception.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-9-shying-away-from-exceptions&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #9: Shying away from exceptions&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
C# continues its enforcement of type safety into runtime. This allows you to pinpoint errors much more quickly than in languages such as C++, where faulty type conversions can result in arbitrary values being assigned to an object’s fields. However, once again, programmers can squander this great feature,leading to C# problems. They fall into this trap because C# provides two different ways of doing things, one which can throw an exception, and one which won’t. Some will shy away from the exception route, figuring that not having to write a try/catch block saves them some coding.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
For example, here are two different ways to perform an explicit type cast in C#:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  // METHOD 1:
  // Throws an exception if account can&#39;t be cast to SavingsAccount
  SavingsAccount savingsAccount = (SavingsAccount)account;
  
  // METHOD 2:
  // Does NOT throw an exception if account can&#39;t be cast to
  // SavingsAccount; will just set savingsAccount to null instead
  SavingsAccount savingsAccount = account as SavingsAccount;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The most obvious error that could occur with the use of Method 2 would be a failure to check the return value. That would likely result in an eventual NullReferenceException, which could possibly surface at a much later time, making it much harder to track down the source of the problem. &amp;nbsp;In contrast, Method 1 would have immediately thrown an&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;InvalidCastException&lt;/code&gt;&amp;nbsp;making the source of the problem much more immediately obvious.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Moreover, even if you remember to check the return value in Method 2, what are you going to do if you find it to &amp;nbsp;be null? Is the method you’re writing an appropriate place to report an error? Is there something else you can try if that cast fails? If not, then throwing an exception is the correct thing to do, so you might as well let it happen as close to the source of the problem as possible.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Here are a couple of examples of other common pairs of methods where one throws an exception and the other does not:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  int.Parse(); &amp;nbsp; &amp;nbsp; // throws exception if argument can’t be parsed
  int.TryParse(); &amp;nbsp;// returns a bool to denote whether parse succeeded
  
  IEnumerable.First(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // throws exception if sequence is empty
  IEnumerable.FirstOrDefault(); &amp;nbsp;// returns null/default value if sequence is empty
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Some programmers are so “exception adverse” that they automatically assume the method that doesn’t throw an exception is superior. &amp;nbsp;While there are certain select cases where this may be true, it is not at all correct as a generalization.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
As a specific example, in a case where you have an alternative legitimate (e.g., default) action to take if an exception would have been generated, then that the non-exception approach could be a legitimate choice. &amp;nbsp;In such a case, it may indeed be better to write something like this:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  if (int.TryParse(myString, out myInt)) {
    // use myInt
  } else {
    // use default value
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
instead of:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  try {
    myInt = int.Parse(myString);
    // use myInt
  } catch (FormatException) {
    // use default value
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
However, it is incorrect to assume that&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TryParse&lt;/code&gt;&amp;nbsp;is therefore necessarily the “better” method. &amp;nbsp;Sometimes that’s the case, sometimes it’s not. That’s why there are two ways of doing it.&amp;nbsp;Use the correct one for the context you are in, remembering that exceptions can certainly be your friend as a developer.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-10-allowing-compiler-warnings-to-accumulate&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #10: Allowing compiler warnings to accumulate&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
While this problem is definitely not C# specific, it is particularly egregious in C# since it abandons the benefits of the strict type checking offered by the C# compiler.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Warnings are generated for a reason. &amp;nbsp;While all C# compiler errors signify a defect in your code, many warnings do as well. What differentiates the two is that, in the case of a warning, the compiler has no problem emitting the instructions your code represents. Even so, it finds your code a little bit fishy, and there is a reasonable likelihood that your code doesn’t accurately reflect your intent.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
A common simple example for the sake of this post is when you modify your algorithm to eliminate the use of a variable you were using, but you forget to remove the variable declaration. The program will run perfectly, but the compiler will flag the useless variable declaration. The fact that the program runs perfectly causes programmers to neglect to fix the cause of the warning. Furthermore, programmers take advantage of a Visual Studio feature which makes it easy for them to hide the warnings in the “Error List” window so they can focus only on the errors. It doesn’t take long until there are dozens of warnings, all of them blissfully ignored (or even worse, hidden).&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
But if you ignore this type of warning, sooner or later, something like this may very well find its way into your code:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  class Account {
  
      int myId;
      int Id; &amp;nbsp; // compiler warned you about this, but you didn’t listen!
  
      // Constructor
      Account(int id) {
          this.myId = Id;&amp;nbsp; &amp;nbsp; &amp;nbsp;// OOPS!
      }
  
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
And at the speed Intellisense allows us to write code, this error isn’t as improbable as it looks.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
You now have a serious error in your program (although the compiler has only flagged it as a warning, for the reasons already explained), and depending on how complex your program is, you could waste a lot of time tracking this one down. Had you paid attention to this warning in the first place, you would have avoided this problem with a simple five-second fix.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Remember, the C# compiler gives you a lot of useful information about the robustness of your code… if you’re listening. Don’t ignore warnings.&lt;/strong&gt;&amp;nbsp;They usually only take a few seconds to fix, and fixing new ones when they happen can save you hours. Train yourself to expect the Visual Studio “Error List” window to display “0 Errors, 0 Warnings”, so that any warnings at all make you uncomfortable enough to address them immediately.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Of course, there are exceptions to every rule. &amp;nbsp;Accordingly, there may be times when your code will look a bit fishy to the compiler, even though it is exactly how you intended it to be. In those very&amp;nbsp;rare cases, use&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;#pragma warning disable [warning id]&lt;/code&gt;&amp;nbsp;around only the code that triggers the warning, and only for the warning ID that it triggers. This will suppress that warning, and that warning only, so that you can still stay alert for new ones.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/54746594412870120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/the-10-most-common-mistakes-that-c_29.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/54746594412870120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/54746594412870120'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/the-10-most-common-mistakes-that-c_29.html' title='The 10 Most Common Mistakes That C# Developers Make'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7VnF9VXhnzcNH0wN-vVUXHAnxN_rE7NVEeprh-11KopQ_BeTQJESQ3wIAIV0Dux7JUjyOfgN_QW8NCrrUWRdCTcG4iYbEJFCFK71XERCVzO7wmKoHuI48_1zRN_lxL5rQ2JU63kdIaDgd/s72-c/pixemweb-cover-art-wp.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-2954942324112045264</id><published>2018-07-29T07:55:00.000-07:00</published><updated>2018-07-29T07:55:16.277-07:00</updated><title type='text'>Must-have Tools for Developers</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuNALG4zRMkiJdFiCaIu5w7uqDaYPofOBYycBpfNYXv6C4TUfHG86S5Rt0GWn8ExZDqpZjC8jm7D1SVf8pas9FNvhQ3fBSuywkpIb_xspiwgGHp-bTqjnk_KcRVt6Yv0wnYUGT8LviZbjd/s1600/533305-636167072919135472-16x9.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;900&quot; data-original-width=&quot;1600&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuNALG4zRMkiJdFiCaIu5w7uqDaYPofOBYycBpfNYXv6C4TUfHG86S5Rt0GWn8ExZDqpZjC8jm7D1SVf8pas9FNvhQ3fBSuywkpIb_xspiwgGHp-bTqjnk_KcRVt6Yv0wnYUGT8LviZbjd/s640/533305-636167072919135472-16x9.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Every developer has list of&amp;nbsp;his favourite tools. These tools make developers more productive and make there life easier. Here are the list of my favourite tools. These are the tools which a developer must have apart from there IDEs. With time and changing focus, this list keeps changing.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;https://www.linqpad.net/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;LinqPad&lt;/a&gt;&lt;/strong&gt;&lt;a href=&quot;https://www.linqpad.net/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;:&lt;/a&gt;&amp;nbsp;LINQPad is not just for LINQ queries, but any C#/F#/VB expression, statement block or program. Put an end to those hundreds of Visual Studio Console projects cluttering your source folder and join the revolution of LINQPad scripters and incremental developers.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;https://tmetric.com/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;TMetric&amp;nbsp;&lt;/a&gt;:&lt;/strong&gt;&amp;nbsp;TMetric is a work time tracker for freelancers, agencies, and companies. Light interface with great control over time intervals and projects’ budgets. Flexible billable rates and crystal clear reporting. Transparent team monitoring and lots of integrations.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Second Monitor : &amp;nbsp;&lt;/strong&gt;While you can accomplish most tasks with only one monitor, two monitors allow you to accomplish the same tasks in a fraction of the time.&amp;nbsp;In fact, dual monitors have been proven to&lt;a href=&quot;http://www.nytimes.com/2006/04/20/technology/20basics.html&quot; rel=&quot;nofollow noopener&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot; target=&quot;_blank&quot;&gt;&amp;nbsp;increase productivity by 20-30 percent&lt;/a&gt;, according to The New York Times’s report of a Jon Peddie Research survey.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;a href=&quot;https://ngrok.com/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ngrok :&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;ngrok allows you to expose a web server running on your local machine to the internet. If you need to show the application running on your location machine to your client or someone who is not in you network this tool can help you in doing so.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SSD or SSHD :&amp;nbsp;&lt;/strong&gt;One thing that every programmer hates is slow system. Most of the programmers have pretty good amount of RAM and faster process in their systems, but still there system may not be as fast as they want, the reason could be HDD(Hard Disk Drive). You can replace HDD with SSD(Solid State Drive) or SSHD(Solid State Hybrid Drive). Like a memory stick, there are no moving parts to an&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SSD&lt;/b&gt;. Rather, information is stored in microchips. Conversely, a&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;hard disk&lt;/b&gt;&amp;nbsp;drive uses a mechanical arm with a read/write head to move around and read information from the right location on a storage platter. This&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;difference&lt;/b&gt;&amp;nbsp;is what makes&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SSD&lt;/b&gt;&amp;nbsp;much faster.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;https://www.piriform.com/ccleaner&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;CCleaner&amp;nbsp;&lt;/a&gt;:&lt;/strong&gt;&amp;nbsp;Registry cleaner and makes your computer faster. There is one free version which you can download from there web site.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;https://www.virtualbox.org/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;VirtualBox&amp;nbsp;&lt;/a&gt;:&lt;/strong&gt;&amp;nbsp;It is one of the best VHD host and manager allowing you to create image of almost any OS and run it on Windows.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;https://www.uberconference.com/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;Uberconference&amp;nbsp;&lt;/a&gt;:&lt;/strong&gt;&amp;nbsp;Hold large or small meetings and web conferences. This is one of my favorites allowing me schedule and manage my webinars.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;http://www.telerik.com/products/decompiler.aspx&quot; rel=&quot;nofollow noopener&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot; target=&quot;_blank&quot;&gt;JustDecompile&lt;/a&gt;&amp;nbsp;:&lt;/strong&gt;&amp;nbsp;New, free developer productivity tool for easy .NET assembly browsing and decompiling and a complete replacement of .NET Reflector (since its no more free).&amp;nbsp; You can also try&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;http://wiki.sharpdevelop.net/ILSpy.ashx&quot; rel=&quot;nofollow noopener&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot; target=&quot;_blank&quot;&gt;ILSpy&lt;/a&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;http://www.helpndoc.com/&quot; rel=&quot;nofollow noopener&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot; target=&quot;_blank&quot;&gt;HelpNDoc&lt;/a&gt;&amp;nbsp;:&lt;/strong&gt;&amp;nbsp;Is a really great tool to generate documentation in PDF, Web-based, CHM, Word and iPhone for&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;personal&lt;/em&gt;&amp;nbsp;use.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;a href=&quot;https://www.google.com/chrome/browser/desktop/index.html&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Google Chrome :&amp;nbsp;&lt;/strong&gt;&lt;/a&gt;The Chrome Developer Tools (DevTools for short), are a set of web authoring and debugging tools built into Google Chrome. The DevTools provide web developers deep access into the internals of the browser and their web application. Use the DevTools to efficiently track down layout issues, set JavaScript breakpoints, and get insights for code optimization.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;http://nimbletext.com/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;NimbleText&lt;/a&gt;&amp;nbsp;:&lt;/strong&gt;&amp;nbsp;Thanks to Scott Hanselman, I have found this program – and my new favorite way to write repetitive code or handle small or large data transformation tasks.&amp;nbsp; I’ve used it from everything from writing HTML to generating SQL insert scripts.&amp;nbsp; Its time-saving power cannot be overstated.&amp;nbsp; And, it’s FREE!&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;http://www.oz-code.com/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;OzCode&lt;/a&gt;&amp;nbsp;:&lt;/strong&gt;&amp;nbsp;If you’re a C# developer, you need OzCode.&amp;nbsp; It turns debugging from a necessary chore to a borderline delight.&amp;nbsp; Break down code expressions, highlight the most needed data in an object, compare data between two objects, find all objects of a given type in memory, and exceptional exception handling make OzCode a star – and that’s just the tip of the iceberg.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;https://github.com/StackExchange/dapper-dot-net&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;Dapper&lt;/a&gt;&amp;nbsp;:&lt;/strong&gt;&amp;nbsp;When I want a way to quickly access a database using SQL, Dapper has my back.&amp;nbsp; Deceptively simple API for what turns out to be a very fast way to access data.&amp;nbsp; Powers the data access layer behind StackExchange, one of the highest traffic websites on the planet.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;https://lastpass.com/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;LastPass&lt;/a&gt;&amp;nbsp;:&lt;/strong&gt;&amp;nbsp;A wonderful password manager that makes managing logins a much easier endeavor.&amp;nbsp; When you’re in IT, you know how crucial it is to keep track of passwords and LastPass makes that much much easier.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;http://www.hanselman.com/blog/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;Scott Hanselman’s Blog&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;: Scott Hanselman is my main man. &amp;nbsp;His blog&amp;nbsp;posts are always interesting and valuable and his contributions to the Microsoft dev world cannot be overstated.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;http://stackexchange.com/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;StackExchange&amp;nbsp;&lt;/a&gt;:&lt;/strong&gt;&amp;nbsp;If StackExchange doesn’t have an answer to your programming question or problem, then you’re probably on your own.&amp;nbsp; Learn from the wisdom of others’ mistakes and find quick, elegant solutions to your programming problems.&amp;nbsp; Chase down those obscure exceptions.&amp;nbsp; If you haven’t used it, then you’ve never used Google to solve a problem.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/2954942324112045264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/must-have-tools-for-developers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/2954942324112045264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/2954942324112045264'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/must-have-tools-for-developers.html' title='Must-have Tools for Developers'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuNALG4zRMkiJdFiCaIu5w7uqDaYPofOBYycBpfNYXv6C4TUfHG86S5Rt0GWn8ExZDqpZjC8jm7D1SVf8pas9FNvhQ3fBSuywkpIb_xspiwgGHp-bTqjnk_KcRVt6Yv0wnYUGT8LviZbjd/s72-c/533305-636167072919135472-16x9.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-4905021926879503292</id><published>2018-07-28T15:15:00.000-07:00</published><updated>2018-07-28T15:15:02.681-07:00</updated><title type='text'>What is a web-hook?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The concept of a WebHook is simple. A WebHook is an HTTP callback: an HTTP POST that occurs when something happens; a simple event-notification via HTTP POST.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
A web application implementing WebHooks will POST a message to a URL when certain things happen.&amp;nbsp;When a web application enables users to register their own URLs, the users can then extend, customize, and integrate that application with their own custom extensions or even with other applications around the web. For the user, WebHooks are a way to receive valuable information&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;when it happens&lt;/em&gt;, rather than continually polling for that data and receiving nothing valuable most of the time. WebHooks have enormous potential and are limited only by your imagination! (No, it can’t wash the dishes. Yet.)&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
WebHooks are meant to&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;do&lt;/em&gt;&amp;nbsp;something. To get your imagination spinning with your own ideas, here are the three general ways in which WebHooks can be used to make&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;your&lt;/em&gt;&amp;nbsp;web more programmable:&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Push: receiving data in real time&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Push is the simplest of reasons to use WebHooks. As was just stated above, no more polling every couple of minutes to find out if there is new information. Just register a WebHook and receive the data at your doorstep as soon as it exists. It’s less work, less hassle, and you’ll probably even receive it sooner than if you were asking for it every couple of minutes.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Pipes: receiving data and passing it on&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
A Pipe happens when your WebHook not only receives real-time data, but goes on to do something new and meaningful with it, triggering actions unrelated to the original event. For example, you create a script, register its URL at a photo site, and have it email you when your mother posts a new photo. Or make a script that creates a Twitter message, and have it triggered by a WebHook whenever you add a new product on your commerce website.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Plugins: processing data and giving something in return&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
This is where the entire web becomes a programming platform. You can use this form of WebHooks to allow others to extend your application.&amp;nbsp;Facebook’s Application Platform uses WebHooks in this way, and so does Google Wave’s robot integration.&amp;nbsp;The general idea is that a web application sending out data via WebHooks will also use the response to modify its own data.&amp;nbsp;At Facebook, when you access an app, Facebook sends a WebHook out to your application saying “Hey, someone’s accessing your application, what do I do?!” The application responds with, “Show the user this page…” Facebook does so, and the pattern continues in the same manner as you continue to use the application. At Google Wave, when you do something in a wave, any robot you’ve added as a participant is notified via a WebHook, and the robot has the ability to modify the wave in its http response. Implement WebHooks in this way in your application if you want to allow others to truly extend and enhance the abilities of your application.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
How do they work?&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
By letting the user specify a URL for various events, the application will POST data to those URLs when the events occur. With the cheap availability of PHP hosting and even easier simple app/script hosting like&amp;nbsp;&lt;a href=&quot;http://appjet.com/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;AppJet&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href=&quot;http://www.scriptlets.org/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;Scriptlets&lt;/a&gt;, handling the POST data becomes fairly trivial. How you use it is up to you and whatever you want to accomplish. Among other things, you can:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;create notifications to you or anybody via email, IRC, Jabber, …&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;put the data in another app (real-time data synchronization)&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;process the data and repost it using the app’s API&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;validate the data and potentially prevent it from being used by the app&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Why should I care?&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
As integrated as we perceive the web, most web applications today operate in silos. With the rise of API’s we’ve seen mashups and some degree of integration between applications. However, we have not seen the vision of the programmable web: a web where you as the user can “pipe” data between apps much like the Unix command line. Some say RSS is the answer.&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;They are wrong.&lt;/strong&gt;&amp;nbsp;The heart is in the right place, but the implementation is wrong. RSS is still useful, but it is not going to bring us the true programmable web.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
We just need a simple way to get data&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;out&lt;/em&gt;&amp;nbsp;in&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;real-time&lt;/em&gt;&amp;nbsp;to let the user&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;easily&lt;/em&gt;&amp;nbsp;do whatever they want with it. That means no polling, no content constraints, and no XML parsing. That means no RSS. Using HTTP is simpler and easier to use. PHP is a very popular and accessible programming environment, so it’s likely to be used often for writing hooklets… getting data from a web POST in PHP is as simple as $_POST[‘something’]. And making the request to the user script is as simple as making an HTTP request, something already built-in to most programming environments. In fact, web hooks are easier to implement than an API.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
However implemented (although the easier the more likely it will be adopted), having an&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;output&lt;/strong&gt;&amp;nbsp;for the web will complement the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;input&lt;/strong&gt;&amp;nbsp;provided by the rising adoption of API’s. When you have both input and output, you have everything you need for apps to easily interact. This will encourage smaller, more focused apps that together with hook-enabled heavier apps will let amazing emergent creations happen!&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
How do I implement WebHooks?&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Simply provide your users with the ability to submit their own URL, and POST to that URL when something happens. It’s that simple. There are no specs you have to follow.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/4905021926879503292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/what-is-web-hook.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/4905021926879503292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/4905021926879503292'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/what-is-web-hook.html' title='What is a web-hook?'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-5147315472376698464</id><published>2018-07-28T15:14:00.001-07:00</published><updated>2018-07-28T15:14:30.876-07:00</updated><title type='text'>Azure storage emulator failed to initialize for Azure SDK 2.6</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
As sudden, I started getting “&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Azure storage emulator failed to initialize for Azure SDK 2.6&lt;/em&gt;” when I try to run my cloud service in emulator. After searching on google for some time I found the solution. Here is that solution step by step. I am posting it here as I did not find a properly explained solution any where else on internet.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Step 1&lt;/strong&gt;&amp;nbsp;: Start your system in safe mode (Immediately after the computer is powered on or restarted tap the F8 key to enter safe mode).&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Step 2&lt;/strong&gt;&amp;nbsp;: In safe mode go the path&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator&lt;/strong&gt;.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Step 3&lt;/strong&gt;&amp;nbsp;: Search for&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;WAStorageEmulator.exe&lt;/strong&gt;&amp;nbsp;– config file.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;enter image description here&quot; src=&quot;https://i.stack.imgur.com/9g58L.png&quot; style=&quot;border: 0px; margin: 0px 0px 10px; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Step 4&lt;/strong&gt;&amp;nbsp;: Edit&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;WAStorageEmulator.exe&lt;/strong&gt;&amp;nbsp;with Notepad++ (any editor).&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;enter image description here&quot; src=&quot;https://i.stack.imgur.com/ZRReb.png&quot; style=&quot;border: 0px; margin: 0px 0px 10px; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Step 5&lt;/strong&gt;&amp;nbsp;: Change the port numbers as shown in the above snapshot. (By default the port numbers will be 10000, 10001, 10002).&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;services&amp;gt;
  &amp;lt;service name=&quot;Blob&quot; url=&quot;http://127.0.0.1:30000/&quot;/&amp;gt;
  &amp;lt;service name=&quot;Queue&quot; url=&quot;http://127.0.0.1:30001/&quot;/&amp;gt;
  &amp;lt;service name=&quot;Table&quot; url=&quot;http://127.0.0.1:30002/&quot;/&amp;gt;
&amp;lt;/services&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Step 6&lt;/strong&gt;&amp;nbsp;: Save the file and restart your system in normal mode and run the program.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
I hope this helps.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/5147315472376698464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/azure-storage-emulator-failed-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/5147315472376698464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/5147315472376698464'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/azure-storage-emulator-failed-to.html' title='Azure storage emulator failed to initialize for Azure SDK 2.6'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-8077050000133678980</id><published>2018-07-28T15:13:00.003-07:00</published><updated>2018-07-28T15:13:59.033-07:00</updated><title type='text'>What is LocalDB and How to use it?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
LocalDB is a new version of SQL Express.&amp;nbsp;LocalDB is created specifically for developers. It is very easy to install and requires no management, yet it offers the same T-SQL language, programming surface and client-side providers as the regular SQL Server Express. In effect the developers that target SQL Server no longer have to install and manage a full instance of SQL Server Express on their laptops and other development machines. Moreover, if the simplicity (and limitations) of LocalDB fit the needs of the target application environment, developers can continue using it in production, as LocalDB makes a pretty good embedded database too.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
LocalDB has the following key properties:&lt;/div&gt;
&lt;ol style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style-image: initial; list-style-position: outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;LocalDB uses the same sqlservr.exe as the regular SQL Express and other editions of SQL Server. The application is using the same client-side providers (ADO.NET, ODBC, PDO and others) to connect to it and operates on data using the same T-SQL language as provided by SQL Express.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;LocalDB is installed once on a machine (per major SQL Server version). Multiple applications can start multiple LocalDB processes, but they are all started from the same sqlservr.exe executable file from the same disk location.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;LocalDB doesn’t create any database services; LocalDB processes are started and stopped automatically when needed. The application is just connecting to “Data Source=(localdb)\v11.0” and LocalDB process is started as a child process of the application. A few minutes after the last connection to this process is closed the process shuts down.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;LocalDB connections support AttachDbFileName property, which allows developers to specify a database file location. LocalDB will attach the specified database file and the connection will be made to it.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
LocalDB Instances&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
As said before, at the heart of LocalDB is the same sqlservr.exe as in the regular SQL Express and other editions of SQL Server. In case of LocalDB, it is installed into one central location together with all necessary DLLs. By default it is located at “C:\Program Files\Microsoft SQL Server\110\LocalDB\Binn”.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
When an application uses any of the client-side providers (like ADO.NET, ODBC or PDO) to connect to “Data Source=(localdb)\v11.0”, the provider will first check if LocalDB instance for the current user is started. If it’s already started the application will connect to it. Otherwise the LocalDB instance for the current user will be started and then the provider proceeds to connect to it. Note that each user (Windows login) may have their own LocalDB instance that is isolated from instances of other users.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Database as a File&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
LocalDB connection strings support AttachDbFileName property that allows attaching a database file during the connection process. This lets developers work directly with databases instead of the database server. Assuming a database file (*.MDF file with the corresponding *.LDF file) is stored at “C:\MyData\Database1.mdf” the developer can start working with it by simply using the following connection string: “Data Source=(localdb)\v11.0;Integrated Security=true;AttachDbFileName=C:\MyData\Database1.mdf”.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
LocalDB and User Instances of SQL Express&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Users familiar with today’s User Instances of SQL Server Express should feel right at home with LocalDB. In essence LocalDB offers the ability to create and start a “user instance” without the hassle of installing and maintaining the parent SQL Express instance. In that respect LocalDB could be seen as an upgrade of the User Instances feature of SQL Server Express.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
LocalDB and SQL Express&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
LocalDB is not a replacement for SQL Server Express — it is an addition to SQL Server Express lineup. While LocalDB is meant for developers, the regular SQL Server Express will continue to exist as a free SQL Server edition, fully compatible with and easily upgradeable to higher SQL Server editions.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
LocalDB and SQL Server Compact?&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Small and simple database, lightweight installation, connecting to a database file — this will sound familiar to any developer using SQL Server Compact. The similarities are not accidental, as our goal for LocalDB was to be as easy to use as SQL Server Compact (while being as powerful and compatible with full SQL Server as SQL Express).&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
There are significant differences between LocalDB and SQL Server Compact:&lt;/div&gt;
&lt;ol style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style-image: initial; list-style-position: outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Execution mode: SQL Server Compact is an in-proc DLL, while LocalDB runs as a separate process.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Disk usage: all SQL Server Compact binaries amount to some 4MBs, while LocalDB installation takes 140MBs.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Features: SQL Server Compact offers core RDBMS functionality like querying, while LocalDB provides a much richer set of features, including Stored Procedures, Geometry and Geography data types, etc.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/8077050000133678980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/what-is-localdb-and-how-to-use-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/8077050000133678980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/8077050000133678980'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/what-is-localdb-and-how-to-use-it.html' title='What is LocalDB and How to use it?'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-3907459573950637983</id><published>2018-07-28T15:13:00.001-07:00</published><updated>2018-07-28T15:13:30.272-07:00</updated><title type='text'>Keyboard Shortcuts (Windows) to Boost Your Productivity</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
General Shortcuts&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Let’s kick start the list with the most common shortcuts that you’ll often use.&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F1&lt;/span&gt;&amp;nbsp;[Display Help]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F2&lt;/span&gt;&amp;nbsp;[Rename the selected item]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F3&lt;/span&gt;&amp;nbsp;[Search for a file or folder]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F4&lt;/span&gt;&amp;nbsp;[Display the address bar list in File Explorer]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F5&lt;/span&gt;&amp;nbsp;[Refresh the active window]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F6&lt;/span&gt;&amp;nbsp;[Cycle through screen elements in a window or on the desktop]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F10&lt;/span&gt;&amp;nbsp;[Activate the Menu bar in the active app]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F4&lt;/span&gt;&amp;nbsp;[Close the active item, or exit the active app]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ESC&lt;/span&gt;&amp;nbsp;[Cycle through items in the order in which they were opened]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Underlined Letter&lt;/span&gt;&amp;nbsp;in menus and dialog box options [Perform the command for that letter]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ENTER&lt;/span&gt;&amp;nbsp;[Display properties for the selected item]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SPACEBAR&lt;/span&gt;&amp;nbsp;[Open the shortcut menu for the active window]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT ARROW&lt;/span&gt;&amp;nbsp;[Back]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;RIGHT ARROW&lt;/span&gt;&amp;nbsp;[Forward]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;PAGE UP&lt;/span&gt;&amp;nbsp;[Move up one screen]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;PAGE DOWN&lt;/span&gt;&amp;nbsp;[Move down one screen]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TAB&lt;/span&gt;&amp;nbsp;[Switch between open apps (except desktop apps)]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F4&lt;/span&gt;&amp;nbsp;[Close the active document (in apps that allow you to have multiple documents open simultaneously)]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;A&lt;/span&gt;&amp;nbsp;[Select all items in a document or window]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;C&lt;/span&gt;&amp;nbsp;or&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;INSERT&lt;/span&gt;&amp;nbsp;[Copy the selected item]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;D / DELETE&lt;/span&gt;&amp;nbsp;[DELETE the selected item and move it to the Recycle Bin]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;R&lt;/span&gt;&amp;nbsp;or&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F5&lt;/span&gt;&amp;nbsp;[Refresh the active window]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;V&lt;/span&gt;&amp;nbsp;or&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;INSERT&lt;/span&gt;&amp;nbsp;[Paste the selected item]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;X&lt;/span&gt;&amp;nbsp;[Cut the selected item]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Y&lt;/span&gt;&amp;nbsp;[Redo an action]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Z&lt;/span&gt;&amp;nbsp;[Undo an action]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;+&lt;/span&gt;&amp;nbsp;or&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;–&lt;/span&gt;&amp;nbsp;[Zoom in or out of a large NUMBER of items, like apps pinned to the Start screen]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+ mouse scroll wheel [Change the size of desktop icons or zoom in or out of a large NUMBER of items, like apps pinned to the Start screen]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;RIGHT ARROW&lt;/span&gt;&amp;nbsp;[Move the cursor to the beginning of the next word]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT ARROW&lt;/span&gt;&amp;nbsp;[Move the cursor to the beginning of the previous word]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;DOWN ARROW&lt;/span&gt;&amp;nbsp;[Move the cursor to the beginning of the next paragraph]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;UP ARROW&lt;/span&gt;&amp;nbsp;[Move the cursor to the beginning of the previous paragraph]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TAB&lt;/span&gt;&amp;nbsp;[Use the arrow keys to switch between all open apps]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ARROW&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SPACEBAR&lt;/span&gt;&amp;nbsp;[Select multiple individual items in a window or on the desktop]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ARROW&lt;/span&gt;&amp;nbsp;[Select a block of text]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ESC&lt;/span&gt;&amp;nbsp;[Open the Start screen]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ESC&lt;/span&gt;&amp;nbsp;[Open Task Manager]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;[Switch the keyboard layout when multiple keyboard layouts are available]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SPACEBAR&lt;/span&gt;&amp;nbsp;[Turn the Chinese input method editor (IME) on or off]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F10&lt;/span&gt;&amp;nbsp;[Display the shortcut menu for the selected item]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ARROW&lt;/span&gt;&amp;nbsp;[Select more than one item in a window or on the desktop, or select text within a document]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;DELETE&lt;/span&gt;&amp;nbsp;[Delete the selected item without moving it to the Recycle Bin first]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;RIGHT ARROW&lt;/span&gt;&amp;nbsp;[Open the next menu to the right, or open a submenu]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT ARROW&lt;/span&gt;&amp;nbsp;[Open the next menu to the left, or close a submenu]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ESC&lt;/span&gt;&amp;nbsp;[Stop or leave the current task]&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Windows key Shortcuts&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Let’s check the keyboard shortcuts involving the Windows logo key. Most of them are introduced in Windows 8’s Metro UI, and can be used in Windows 8 and above.&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F1&lt;/span&gt;&amp;nbsp;[Open Windows Help and support]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;[Display or hide the Start screen]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;B&lt;/span&gt;&amp;nbsp;[Set focus in the notification area]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;C&lt;/span&gt;&amp;nbsp;[Open Charms]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;D&lt;/span&gt;&amp;nbsp;[Display and hide the desktop]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;E&lt;/span&gt;&amp;nbsp;[Open File Explorer]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F&lt;/span&gt;&amp;nbsp;[Open the Search charm and search for files]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;H&lt;/span&gt;&amp;nbsp;[Open the Share charm]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;I&lt;/span&gt;&amp;nbsp;[Open the Settings charm]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;K&lt;/span&gt;&amp;nbsp;[Open the Devices charm]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;L&lt;/span&gt;&amp;nbsp;[Lock your PC or switch people]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;M&lt;/span&gt;&amp;nbsp;[Minimize all windows]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;O&lt;/span&gt;&amp;nbsp;[Lock device orientation]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;P&lt;/span&gt;&amp;nbsp;[Choose a presentation display mode]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Q&lt;/span&gt;&amp;nbsp;[Open the Search charm to search everywhere or within the open app (if the app supports app search)]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;R&lt;/span&gt;&amp;nbsp;[Open the Run dialog box]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;S&lt;/span&gt;&amp;nbsp;[Open the Search charm to search Windows and the web]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;T&lt;/span&gt;&amp;nbsp;[Cycle through apps on the task bar]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;U&lt;/span&gt;&amp;nbsp;[Open Ease of Access Center]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;V&lt;/span&gt;&amp;nbsp;[Cycle through notifications]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;V&lt;/span&gt;&amp;nbsp;[Cycle through notifications in reverse order]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;W&lt;/span&gt;&amp;nbsp;[Open the Search charm and search for settings]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;X&lt;/span&gt;&amp;nbsp;[Open the Quick Link menu]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Z&lt;/span&gt;&amp;nbsp;[Show the commands available in the app]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&amp;nbsp;[Temporarily peek at the desktop]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;PAUSE&lt;/span&gt;&amp;nbsp;[Display the System Properties dialog box]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F&lt;/span&gt;&amp;nbsp;[Search for PCs (if you’re on a network)]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;M&lt;/span&gt;&amp;nbsp;[Restore minimized windows on the desktop]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(NUMBER 1-9)&lt;/span&gt;&amp;nbsp;[Open the desktop and start the app pinned to the task bar in the position indicated by the number. If the app is already running, it switches to that app.]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(NUMBER 1-9)&lt;/span&gt;&amp;nbsp;[Open the desktop and start a new instance of the app pinned to the taskbar in the position indicated by the number]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(NUMBER 1-9)&lt;/span&gt;&amp;nbsp;[Open the desktop and switch to the last active window of the app pinned to the taskbar in the position indicated by the number]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(NUMBER 1-9)&lt;/span&gt;&amp;nbsp;[Open the desktop and open the Jump List for the app pinned to the taskbar in the position indicated by the number]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(NUMBER 1-9)&lt;/span&gt;&amp;nbsp;[Open the desktop and open a new instance of the app located at the given position on the taskbar as an administrator]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TAB&lt;/span&gt;&amp;nbsp;[Cycle through recently used apps (except desktop apps)]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TAB&lt;/span&gt;&amp;nbsp;[Cycle through recently used apps (except desktop apps)]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TAB&lt;/span&gt;&amp;nbsp;[Cycle through recently used apps (except desktop apps) in reverse order]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;B&lt;/span&gt;&amp;nbsp;[Switch to the app that displayed a message in the notification area]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;UP ARROW&lt;/span&gt;&amp;nbsp;[Maximize the window]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;DOWN ARROW&lt;/span&gt;&amp;nbsp;[Remove current app from screen or minimize the desktop window]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT ARROW&lt;/span&gt;&amp;nbsp;[Maximize the app or desktop window to the LEFT side of the screen]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;RIGHT ARROW&lt;/span&gt;&amp;nbsp;[Maximize the app or desktop window to the RIGHT side of the screen]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;HOME&lt;/span&gt;&amp;nbsp;[Minimize all but the active desktop window (restores all windows on second stroke)]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;UP ARROW&lt;/span&gt;&amp;nbsp;[Stretch the desktop window to the top and bottom of the screen]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;DOWN ARROW&lt;/span&gt;&amp;nbsp;[Restore/minimize active desktop windows vertically, maintaining width]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT ARROW&lt;/span&gt;&amp;nbsp;or&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;RIGHT ARROW&lt;/span&gt;&amp;nbsp;[Move an app or window in the desktop from one monitor to another]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SPACEBAR&lt;/span&gt;&amp;nbsp;[Switch input language and keyboard layout]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SPACEBAR&lt;/span&gt;&amp;nbsp;[Change to a previously selected input]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ENTER&lt;/span&gt;&amp;nbsp;[Open Narrator]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&amp;nbsp;[Cycle through open apps]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&amp;nbsp;[Cycle through open apps]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/&lt;/span&gt;&amp;nbsp;[Initiate IME reconversion]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ENTER&lt;/span&gt;&amp;nbsp;[Open WindowsMedia Center]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;+/-&lt;/span&gt;&amp;nbsp;[Zoom in or out using Magnifier]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ESC&lt;/span&gt;&amp;nbsp;[Exit Magnifier]&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Dialog box Shortcuts&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
These are the keyboard shortcuts that can be used in dialog boxes.&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F1&lt;/span&gt;&amp;nbsp;[Display Help]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F4&lt;/span&gt;&amp;nbsp;[Display the items in the active list]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TAB&lt;/span&gt;&amp;nbsp;[Move forward through tabs]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TAB&lt;/span&gt;&amp;nbsp;[Move back through tabs]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(NUMBER 1-9)&lt;/span&gt;&amp;nbsp;[Move to&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;nth&lt;/em&gt;&amp;nbsp;tab]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TAB&lt;/span&gt;&amp;nbsp;[Move forward through options]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TAB&lt;/span&gt;&amp;nbsp;[Move back through options]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Underlined Letter&lt;/span&gt;&amp;nbsp;in menus and dialog box options [Perform the command (or select the option) that goes with that letter]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SPACEBAR&lt;/span&gt;&amp;nbsp;[Select or clear the check box if the active option is a check box]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;BACKSPACE&lt;/span&gt;&amp;nbsp;[Open a folder one level up if a folder is selected in the Save As or Open dialog box]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ARROW&lt;/span&gt;&amp;nbsp;keys [Select a button if the active option is a group of option buttons]&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
File explorer Shortcuts&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
These are the shortcuts that can be used to work with File Explorer’s windows or folders.&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;D&lt;/span&gt;&amp;nbsp;[Select the address bar]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;E&lt;/span&gt;&amp;nbsp;[Select the search box]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F&lt;/span&gt;&amp;nbsp;[Select the search box]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;N&lt;/span&gt;&amp;nbsp;[Open a new window]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;W&lt;/span&gt;&amp;nbsp;[Close the current window]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+ mouse scroll wheel [Change the size and appearance of file and folder icons]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;E&lt;/span&gt;&amp;nbsp;[Display all folders above the selected folder]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;N&lt;/span&gt;&amp;nbsp;[Create a new folder]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;NUM LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;&amp;nbsp;[Display all subfolders under the selected folder]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;NUM LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;+&lt;/span&gt;&amp;nbsp;[Display the contents of the selected folder]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;NUM LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;–&lt;/span&gt;&amp;nbsp;[Collapse the selected folder]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;P&lt;/span&gt;&amp;nbsp;[Display the preview pane]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ENTER&lt;/span&gt;&amp;nbsp;[Open the Properties dialog box for the selected item]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;RIGHT ARROW&lt;/span&gt;&amp;nbsp;[View the next folder]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;UP ARROW&lt;/span&gt;&amp;nbsp;[View the folder that the folder was in]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT ARROW&lt;/span&gt;&amp;nbsp;[View the previous folder]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;BACKSPACE&lt;/span&gt;&amp;nbsp;[View the previous folder]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;RIGHT ARROW&lt;/span&gt;&amp;nbsp;[Display the current selection (if it’s collapsed), or select the first subfolder]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT ARROW&lt;/span&gt;&amp;nbsp;[Collapse the current selection (if it’s expanded), or select the folder that the folder was in]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;END&lt;/span&gt;&amp;nbsp;[Display the bottom of the active window]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;HOME&lt;/span&gt;&amp;nbsp;[Display the top of the active window]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F11&lt;/span&gt;&amp;nbsp;[Maximize or minimize the active window]&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Task bar Shortcuts&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Here are the keyboard shortcuts to work with items on the Desktop’s taskbar.&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+ Click a&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Taskbar Button&lt;/span&gt;&amp;nbsp;[Open an app or quickly open another instance of an app]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+ Click a&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Taskbar Button&lt;/span&gt;&amp;nbsp;[Open an app as an administrator]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+ Right-click a&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Taskbar Button&lt;/span&gt;&amp;nbsp;[Show the window menu for the app]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;+ Right-click a&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Grouped Taskbar Button&lt;/span&gt;&amp;nbsp;[Show the window menu for the groUP]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+ Click a&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Grouped Taskbar Button&lt;/span&gt;&amp;nbsp;[Cycle through the windows of the groUP]&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Ease of access Shortcuts&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
These are the keyboard shortcuts to help you use your computer easily.&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Hold&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;RIGHT SHIFT&lt;/span&gt;&amp;nbsp;for eight seconds [Turn Filter Keys on and off]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;PRINT SCREEN&lt;/span&gt;&amp;nbsp;[Turn High Contrast on or off]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT SHIFT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;NUM LOCK&lt;/span&gt;&amp;nbsp;[Turn Mouse Keys on or off]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Press&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SHIFT&lt;/span&gt;&amp;nbsp;five times [Turn Sticky Keys on or off]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Press&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;NUM LOCK&lt;/span&gt;&amp;nbsp;for five seconds [Turn Toggle Keys on or off]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;U&lt;/span&gt;&amp;nbsp;[Open the Ease of Access Center]&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Magnifier Shortcuts&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Here are the keyboard shortcuts to help you use Magnifier.&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;+&lt;/span&gt;&amp;nbsp;[Zoom in]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;–&lt;/span&gt;&amp;nbsp;[Zoom out]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SPACEBAR&lt;/span&gt;&amp;nbsp;[Preview the desktop in full-screen mode]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;D&lt;/span&gt;&amp;nbsp;[Switch to docked mode]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F&lt;/span&gt;&amp;nbsp;[Switch to full-screen mode]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;I&lt;/span&gt;&amp;nbsp;[Invert colors]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;L&lt;/span&gt;&amp;nbsp;[Switch to lens mode]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;R&lt;/span&gt;&amp;nbsp;[Resize the lens]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ARROW&lt;/span&gt;&amp;nbsp;keys [Pan in the direction of the ARROW keys]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Win&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ESC&lt;/span&gt;&amp;nbsp;[Exit Magnifier]&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Narrator Shortcuts&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
These are the keyboard shortcuts to help you use Narrator.&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SPACEBAR&lt;/span&gt;&amp;nbsp;or&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ENTER&lt;/span&gt;&amp;nbsp;[Activate current item]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TAB&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ARROW Keys&lt;/span&gt;&amp;nbsp;[Move around on the screen]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;[Stop reading]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CAPS LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;D&lt;/span&gt;&amp;nbsp;[Read item]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CAPS LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;M&lt;/span&gt;&amp;nbsp;[Start reading]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CAPS LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;H&lt;/span&gt;&amp;nbsp;[Read document]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CAPS LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;V&lt;/span&gt;&amp;nbsp;[Repeat phrase]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CAPS LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;W&lt;/span&gt;&amp;nbsp;[Read window]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CAPS LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;PAGE UP&lt;/span&gt;&amp;nbsp;or&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;PAGE DOWN&lt;/span&gt;&amp;nbsp;[Increase or decrease the volume of the voice]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CAPS LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;+/-&lt;/span&gt;&amp;nbsp;[Increase or decrease the speed of the voice]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CAPS LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SPACEBAR&lt;/span&gt;&amp;nbsp;[Do default action]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CAPS LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT&lt;/span&gt;&amp;nbsp;or&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;RIGHT ARROW&lt;/span&gt;&amp;nbsp;[Move to previous/next item]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CAPS LOCK&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F2&lt;/span&gt;&amp;nbsp;[Show commands for current item]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Caps&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ESC&lt;/span&gt;&amp;nbsp;[Exit Narrator]&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Remote desktop connection Shortcuts&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
These are the keyboard shortcuts to ease the use of remote desktop connection.&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;PAGE UP&lt;/span&gt;&amp;nbsp;[Move between apps, left to right]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;PAGE DOWN&lt;/span&gt;&amp;nbsp;[Move between apps, right to left]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;INSERT&lt;/span&gt;&amp;nbsp;[Cycle through apps in the order that they were started]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;HOME&lt;/span&gt;&amp;nbsp;[Display the Start screen]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;BREAK&lt;/span&gt;&amp;nbsp;[Switch between a window and full screen]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;END&lt;/span&gt;&amp;nbsp;[Display the Windows Security dialog box]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;HOME&lt;/span&gt;&amp;nbsp;[In full-screen mode, activate the connection bar]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;DELETE&lt;/span&gt;&amp;nbsp;[Display the system menu]&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;–&lt;/span&gt;&amp;nbsp;[Place a copy of the active window, within the client, on the Terminal server clipboard (similar to&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;PRINT SCREEN&lt;/span&gt;&amp;nbsp;on a local PC)]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;+&lt;/span&gt;&amp;nbsp;[Place a copy of the entire client window area on the Terminal server clipboard (similar to&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Print Screen&lt;/span&gt;&amp;nbsp;on a local PC)]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;RIGHT ARROW&lt;/span&gt;&amp;nbsp;[&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TAB&lt;/span&gt;&amp;nbsp;out of the Remote Desktop controls to a control in the host app (for example, a button or a text box). Useful when the Remote Desktop controls are embedded in another (host) app.]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT ARROW&lt;/span&gt;&amp;nbsp;[&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TAB&lt;/span&gt;out of the Remote Desktop controls to a control in the host app (for example, a button or a text box). Useful when the Remote Desktop controls are embedded in another (host) app.]&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Help viewer Shortcuts&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
These are the keyboard shortcuts that can be used with the help viewer.&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F3&lt;/span&gt;&amp;nbsp;[Move the cursor to the search box]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F10&lt;/span&gt;&amp;nbsp;[Display the Options menu]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;HOME&lt;/span&gt;&amp;nbsp;[Move to the beginning of a topic]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;END&lt;/span&gt;&amp;nbsp;[Move to the end of a topic]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;LEFT ARROW&lt;/span&gt;&amp;nbsp;[Move back to the previously viewed topic]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;RIGHT ARROW&lt;/span&gt;&amp;nbsp;[Move to the next (previously viewed) topic]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;HOME&lt;/span&gt;&amp;nbsp;[Display the Help and support home page]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;A&lt;/span&gt;&amp;nbsp;[Display the customer support page]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;C&lt;/span&gt;&amp;nbsp;[Display the TABle of Contents]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALT&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;N&lt;/span&gt;&amp;nbsp;[Display the Connection Settings menu]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;F&lt;/span&gt;&amp;nbsp;[Search the current topic]&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CTRL&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span class=&quot;key&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;P&lt;/span&gt;&amp;nbsp;[Print a topic]&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/3907459573950637983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/keyboard-shortcuts-windows-to-boost.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/3907459573950637983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/3907459573950637983'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/keyboard-shortcuts-windows-to-boost.html' title='Keyboard Shortcuts (Windows) to Boost Your Productivity'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-1109236893928112284</id><published>2018-07-28T15:12:00.001-07:00</published><updated>2018-07-28T15:12:39.817-07:00</updated><title type='text'>Principles of Good Programming</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The principles of good programming are closely related to principles of good design and engineering. The following programming principles have helped me over the years become a better programmer, and I believe can help any developer become more efficient and to produce code which is easier to maintain and that has fewer defects.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;DRY – Don’t repeat yourself&lt;/strong&gt;&amp;nbsp;– This is probably the single most fundamental tenet in programming is to avoid repetition. Many programming constructs exist solely for that purpose (e.g. loops, functions, classes, and more). As soon as you start repeating yourself (e.g. a long expression, a series of statements, same concept) create a new abstraction.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Abstraction Principle&lt;/strong&gt;&amp;nbsp;– Related to DRY is the abstraction principle “Each significant piece of functionality in a program should be implemented in just one place in the source code.”&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;KISS (Keep it simple, stupid!)&lt;/strong&gt;&amp;nbsp;– Simplicity (and avoiding complexity) should always be a key goal. Simple code takes less time to write, has fewer bugs, and is easier to modify.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Avoid Creating a YAGNI (You aren’t going to need it)&lt;/strong&gt;&amp;nbsp;– You should try not to add functionality until you need it.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Do the simplest thing that could possibly work&lt;/strong&gt;&amp;nbsp;– A good question to ask one’s self when programming is “What is the simplest thing that could possibly work?” This helps keep us on the path towards simplicity in the design.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Don’t make me think&lt;/strong&gt;&amp;nbsp;– This is actually the title of a book by Steve Krug on web usability that is also relevant in programming. The point is that code should be easily read and understood with a minimum of effort required. If code requires too much thinking from an observer to understand, then it can probably stand to be simplified&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Open/Closed Principle&lt;/strong&gt;&amp;nbsp;– Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. In other words, don’t write classes that people can modify, write classes that people can extend.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Write Code for the Maintainer&lt;/strong&gt;&amp;nbsp;– Almost any code that is worth writing is worth maintaining in the future, either by you or by someone else. The future you who has to maintain code often remembers as much of the code, as a complete stranger, so you might as well always write for someone else. A memorable way to remember this is “Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live.”&amp;nbsp;&lt;img alt=&quot;😛&quot; class=&quot;emoji&quot; draggable=&quot;false&quot; src=&quot;https://s.w.org/images/core/emoji/2.4/svg/1f61b.svg&quot; style=&quot;background: none !important; border: none !important; box-shadow: none !important; display: inline !important; height: 1em !important; margin-bottom: 10px; margin-left: 0.07em !important; margin-right: 0.07em !important; margin-top: 0px !important; max-width: 100%; padding: 0px !important; vertical-align: -0.1em !important; width: 1em !important;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Principle of least astonishment&lt;/strong&gt;&amp;nbsp;– The principle of least astonishment is usually referenced in regards to the user interface, but the same principle applies to written code. Code should surprise the reader as little as possible. The means following standard conventions, code should do what the comments and name suggest, and potentially surprising side effects should be avoided as much as possible.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Single Responsibility Principle&lt;/strong&gt;&amp;nbsp;– A component of code (e.g. class or function) should perform a single well defined task.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Minimize Coupling&lt;/strong&gt;&amp;nbsp;– Any section of code (code block, function, class, etc) should minimize the dependencies on other areas of code. This is achieved by using shared variables as little as possible. “Low coupling is often a sign of a well-structured computer system and a good design, and when combined with high cohesion, supports the general goals of high readability and maintainability”&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Maximize Cohesion&lt;/strong&gt;&amp;nbsp;– Code that has similar functionality should be found within the same component.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Hide Implementation Details&lt;/strong&gt;&amp;nbsp;– Hiding implementation details allows change to the implementation of a code component while minimally affecting any other modules that use that component.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Law of Demeter&lt;/strong&gt;&amp;nbsp;– Code components should only communicate with their direct relations (e.g. classes that they inherit from, objects that they contain, objects passed by argument, etc.)&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Avoid Premature Optimization&lt;/strong&gt;&amp;nbsp;– Don’t even think about optimization unless your code is working, but slower than you want. Only then should you start thinking about optimizing, and then only with the aid of empirical data. “We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil” – Donald Knuth.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Code Reuse is Good&lt;/strong&gt;&amp;nbsp;– Not very pithy, but as good a principle as any other. Reusing code improves code reliability and decrease development time.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Separation of Concerns&lt;/strong&gt;&amp;nbsp;– Different areas of functionality should be managed by distinct and minimally overlapping modules of code.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Embrace Change&lt;/strong&gt;&amp;nbsp;– This is the subtitle of a book by Kent Beck, and is also considered a tenet of extreme programming and the agile methodology in general. Many other principles are based on the concept that you should expect and welcome change. In fact very old software engineering principles like minimizing coupling are related directly to the requirement of making code easier to change. Whether or not you are an extreme programming practitioner, this approach to writing code just makes sense.&lt;/div&gt;
&lt;div class=&quot;linked-out&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Prefer Composition over Inheritance –&amp;nbsp;&lt;/strong&gt;The&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;“composition over inheritance” principle&lt;/strong&gt;&amp;nbsp;states that objects with complex behaviors should do so by containing instances of objects with individual behaviors rather than inheriting a class and adding new behaviors.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Over reliance on inheritance can lead to two major issues. First, the inheritance hierarchy can become messy in the blink of an eye. Second, you have less flexibility for defining special-case behaviors, particularly when you want to implement behavior from one inheritance branch in another inheritance branch:&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Composition is a lot cleaner to write, easier to maintain, and allows for near-infinite flexibility as far as what kinds of behaviors you can define. Each individual behavior is its own class, and you create complex behaviors by combining individual behaviors.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Refactor, Refactor and Refactor&lt;/b&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp;–&amp;nbsp;&lt;/strong&gt;One of the hardest truths to accept as an inexperienced programmer is that&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;code rarely comes out right the first time&lt;/strong&gt;. It may&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;feel&lt;/em&gt;&amp;nbsp;right when you implement that shiny new feature, but as your program grows in complexity, future features may be hindered by how you wrote that early one. Code bases are constantly evolving. It’s completely normal to revisit, rewrite, or even redesign entire chunks of code — and not just normal, but healthy to do so. You know more about your project’s needs&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;now&lt;/em&gt;&amp;nbsp;than when you did at the&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;start&lt;/em&gt;, and you should regularly use this newly gained knowledge to refactor old code.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Clean code is better then Cleaver Code –&amp;nbsp;&lt;/b&gt;Speaking of clean code, leave your ego at the door and&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;forget about writing clever code&lt;/strong&gt;. You know what I’m talking about: the kind of codee that looks more like a riddle than a solution and exists solely to show off how smart you are. The truth is, nobody really cares.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
One example of clever code is packing as much logic into one line as possible. Another example is exploiting a language’s intricacies to write strange but functional statements. Anything that might cause someone to say “Wait, what?” when poring over your code.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/1109236893928112284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/principles-of-good-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/1109236893928112284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/1109236893928112284'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/principles-of-good-programming.html' title='Principles of Good Programming'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-502591251886441983</id><published>2018-07-28T15:11:00.003-07:00</published><updated>2018-07-28T15:11:57.037-07:00</updated><title type='text'>Accessing File Stored in Windows Azure Blob Storage Using jQuery</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Did you know it was possible to access the Windows Azure Blob Storage directly from JavaScript, for example using jQuery?&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
At first, it sounds obvious, since Blobs are after all accessible from a public UR. But in practice, there is a very big hurdle: the Web browser’s Same Origine Policy or SOP, that restricts JavaScript code to accessing resources originating from the same site the script was loaded from. This means that you will never be able to load a Windows Azure Blob using XMLHttpRequest for example!&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Fortunately, there is a popular workaround called JSONP (“JSON with Padding”). The idea behind this technique is that the script tag is not submitted to the SOP: an HTML page can thus load a JavaScript file from any site. So, if you expose your data in an “executable” form in JavaScript, a page will be able to load this data using a script tag. For example:&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;lt;script type=”text/javascript” src=”http://www.sandeepknarware.in/exemple.jsonp”&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
But how can you make data executable? This is what the “Padding” in JSONP is about: you are going to pad, or surround, your JSON data with a function call. In my example, the exemple.jsonp file could contain:&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
jsonpCallback({“Nom”: “Thomas”, “Id” : 42,})&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
When this script will be loaded by the script tag, this will trigger a call to a jsonpCallback function that will receive the JSON data as a parameter.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
It is thus very simple to adapt this technique to Windows Azure Storage! All we need to do is to create Blob conforming to the JSONP convention, and we will be able to call them from a JavaScript program.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Here is for example a sample JSON Blob on my public Windows Azure Storage. It is fairly large (more than 200 KB) and contains a data structure describing the most popular Facebook “likes” from my friends (no surprise, lots of Microsoft-related stuff in there!) The data structure itself is organized as a JavaScript array of objects like this:&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
[&lt;br /&gt;{&lt;br /&gt;“Nb”: 60,&lt;br /&gt;“Id”: “129459787073480”,&lt;br /&gt;“Name”: “Developpeurs”,&lt;br /&gt;“Category”: “Product/service”,&lt;br /&gt;“Timestamp”: “/Date(1312886077750)/”,&lt;br /&gt;“PartitionKey”: “687276944”,&lt;br /&gt;“RowKey”: “129459787073480”&lt;br /&gt;},&lt;br /&gt;{&lt;br /&gt;“Nb”: 44,&lt;br /&gt;“Id”: “343983715428”,&lt;br /&gt;“Name”: “Windows Phone France”,&lt;br /&gt;“Category”: “Product/service”,&lt;br /&gt;“Timestamp”: “/Date(1312886077780)/”,&lt;br /&gt;“PartitionKey”: “687276944”,&lt;br /&gt;“RowKey”: “343983715428”&lt;br /&gt;},&lt;br /&gt;{&lt;br /&gt;“Nb”: 43,&lt;br /&gt;“Id”: “192285182795”,&lt;br /&gt;“Name”: “Visual Studio 2010 en France”,&lt;br /&gt;“Category”: “Product/service”,&lt;br /&gt;“Timestamp”: “/Date(1312886081737)/”,&lt;br /&gt;“PartitionKey”: “687276944”,&lt;br /&gt;“RowKey”: “192285182795”&lt;br /&gt;},&lt;br /&gt;{&lt;br /&gt;“Nb”: 40,&lt;br /&gt;“Id”: “20528438720”,&lt;br /&gt;“Name”: “Microsoft”,&lt;br /&gt;“Category”: “Company”,&lt;br /&gt;“Timestamp”: “/Date(1312886077553)/”,&lt;br /&gt;“PartitionKey”: “687276944”,&lt;br /&gt;“RowKey”: “20528438720”&lt;br /&gt;}&lt;br /&gt;]&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
All you need to do is to surround this data structure with a function call to e.g. dataCallback:&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
dataCallback(…your JSON goes here…)&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Once you have your data stored as JSON Blobs, all you need to do is to load it, and in order to simplify the (many) implementation details, I will use jQuery’s excellent AJAX functions, that perfectly well equipped to deal with JSONP ; all you need to do is find the right parameters.&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;tCont hljs javascript active&quot; style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
$.ajax({&lt;br /&gt;url: ‘http://tcontepub.blob.core.windows.net/json/687276944.json’,&lt;br /&gt;dataType: ‘jsonp’,&lt;br /&gt;jsonpCallback: ‘dataCallback’,&lt;br /&gt;success: function(data) {&lt;br /&gt;$.each(data, function(i, v) {&lt;br /&gt;$(‘#likes’).append($(‘&amp;lt;li&amp;gt;’, {&lt;br /&gt;text: v.Name&lt;br /&gt;}));&lt;br /&gt;});&lt;br /&gt;}&lt;br /&gt;});&lt;/div&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
&lt;div class=&quot;google-auto-placed&quot; style=&quot;background-color: white; border: 0px; clear: none; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; height: auto; margin: 0px; padding: 0px; text-align: center; vertical-align: baseline; width: 604.813px;&quot;&gt;
&lt;ins class=&quot;adsbygoogle adsbygoogle-noablate&quot; data-ad-client=&quot;ca-pub-3374939295083809&quot; data-ad-format=&quot;auto&quot; data-adsbygoogle-status=&quot;done&quot; style=&quot;background: none transparent; border: 0px; display: block; height: 60px; margin: 10px auto 20px; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;&lt;ins id=&quot;aswift_6_expand&quot; style=&quot;background: none transparent; border: none; display: inline-table; height: 60px; margin: 0px; padding: 0px; position: relative; text-decoration-line: none; vertical-align: baseline; visibility: visible; width: 605px;&quot;&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 1.71429; margin: 0px 0px 20px; orphans: 2; padding: 0px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
Nothing really remarkable, all you need to do is to pass to jQuery the same callback name you used in your JSONP file! This is what the following parameter does:&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/502591251886441983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/accessing-file-stored-in-windows-azure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/502591251886441983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/502591251886441983'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/accessing-file-stored-in-windows-azure.html' title='Accessing File Stored in Windows Azure Blob Storage Using jQuery'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-8037431069051165516</id><published>2018-07-28T15:11:00.001-07:00</published><updated>2018-07-28T15:11:04.891-07:00</updated><title type='text'>Temporal Tables in Azure SQL Database</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Temporal Tables allow you to track the full history of data changes directly in Azure SQL Database, without the need for custom coding. With Temporal Tables you can see your data as of any point in time in the past and use declarative cleanup policy to control retention for the historical data.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
When to use Temporal Tables?&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Quite often you may be in the situation to ask yourself fundamental questions: How did important information look yesterday, a month ago, a year ago, etc. What changes have been made since the beginning of the year? What were the dominant trends during a specific period of time?&amp;nbsp; Without proper support in the database, however, questions like these have never been easy to answer.&lt;br /&gt;Temporal Tables are designed to improve&amp;nbsp;your productivity when you develop applications that work with ever-changing data and when you want to derive important insights from the changes.&lt;br /&gt;Use Temporal Tables to:&lt;/div&gt;
&lt;ol style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style-image: initial; list-style-position: outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Support data auditing in your applications&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Analyze trends or detect anomalies over time&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Easily implement slowly changing dimension pattern&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Perform fine-grained row repairs in case of accidental data errors made by humans or applications&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Manage historical data with easy-to-use retention policy&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Keeping history of changes tends to increase database size, especially if historical data is retained for a longer period of time. Hence, retention policy for historical data is an important aspect of planning and managing the lifecycle of every temporal table.&amp;nbsp; Temporal Tables in Azure SQL Database come with an extremely easy-to-use retention mechanism. Applying retention policy is very simple: it requires users to set single parameter during the table creation or table schema change, like shown in the following example.&lt;/div&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ALTER TABLE &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;WebSiteClicks&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
SET 
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
 SYSTEM_VERSIONING &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; ON 
 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
  HISTORY_TABLE &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; dbo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;typ&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;WebSiteClicks_History&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; 
                HISTORY_RETENTION_PERIOD &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; MONTHS  
 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
You can alter retention policy at any moment and your change will be effective immediately.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Why you should consider Temporal Tables?&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If you have requirements for tracking data changes, using Temporal Tables will give you multiple benefits over any custom solution. Temporal Tables will simplify every phase in the development lifecycle: object creation, schema evolution, data modification, point-in-time analysis and data aging.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/8037431069051165516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/temporal-tables-in-azure-sql-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/8037431069051165516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/8037431069051165516'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/temporal-tables-in-azure-sql-database.html' title='Temporal Tables in Azure SQL Database'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-2957194850198862499</id><published>2018-07-28T15:10:00.004-07:00</published><updated>2018-07-28T15:10:43.733-07:00</updated><title type='text'>Concatenate All Column Values in Sql</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If you work with the SQL&amp;nbsp;you might have came across this question sometime.&amp;nbsp;How to Concatenate all column values from different rows returned from a SQL query into one value?&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
This is an example:&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
a query returns:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;FOO
------
RES1

RES2

RES3
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
now we want to have a result like the following one:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;FOOCONCAT
-----
RES1RES2RES3
&lt;/pre&gt;
&lt;h4 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span id=&quot;more-25&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Here is the solution&lt;/h4&gt;
&lt;div class=&quot;post-text&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQL Server&lt;/code&gt;:&lt;/div&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  col1 &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;AS&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()]&lt;/span&gt;
&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;    foo
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;FOR&lt;/span&gt; &lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;XML&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; PATH &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;MySQL&lt;/code&gt;:&lt;/div&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  GROUP_CONCAT&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;col1 SEPARATOR &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;    foo&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;PostgreSQL&lt;/code&gt;:&lt;/div&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  array_to_string
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
        ARRAY
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  col1
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;    foo
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;str&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;&#39;&lt;/span&gt;
        &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Oracle&lt;/code&gt;:&lt;/div&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;  &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;
&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;FROM&lt;/span&gt;    &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  col1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; ROW_NUMBER&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;OVER&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;lit&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;AS&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; rn
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;    foo
        MODEL
        DIMENSION &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;BY&lt;/span&gt;
                &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;rn&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
        MEASURES
                &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;col1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; col1 &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;AS&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; group_concat&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;AS&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; mark&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
        RULES &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;UPDATE&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
                group_concat&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;rn &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;lit&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  group_concat&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CV&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;lit&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; col1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CV&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()],&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
                mark&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ANY&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; PRESENTV&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;mark&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CV&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;lit&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;lit&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;WHERE&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;   mark &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/2957194850198862499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/concatenate-all-column-values-in-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/2957194850198862499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/2957194850198862499'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/concatenate-all-column-values-in-sql.html' title='Concatenate All Column Values in Sql'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-1577897483708597561</id><published>2018-07-28T15:10:00.002-07:00</published><updated>2018-07-28T15:10:13.869-07:00</updated><title type='text'>How to Copy Azure SQL Database to Local SQL Server</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Azure SQL Database is a relational database-as-a service using the Microsoft SQL Server Engine. SQL Database is a high-performance, reliable, and secure database you can use to build data-driven applications and websites in the programming language of your choice, without needing to manage infrastructure.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Some times you may want to create a copy of azure database on you local server. So that you can use it for development and bugging activities.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Here’s what you do when you want to get a local copy of an Azure SQL Database.&lt;/div&gt;
&lt;h3 id=&quot;Export-Azure-Database&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Export Azure Database&lt;/h3&gt;
&lt;ol style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style-image: initial; list-style-position: outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Select your database in the Azure Portal.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Click Export in the Header&lt;img alt=&quot;&quot; class=&quot;size-medium wp-image-72 aligncenter&quot; height=&quot;64&quot; sizes=&quot;(max-width: 300px) 100vw, 300px&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/azure-sql-header-300x64.png&quot; srcset=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/azure-sql-header-300x64.png 300w, http://www.sandeepknarware.in/wp-content/uploads/2017/09/azure-sql-header.png 359w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; width=&quot;300&quot; /&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Give it a name, storage, container, etc and start the export.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Once export is completed.&amp;nbsp;Select your server and scroll to the bottom and click on Import/Export History&lt;img alt=&quot;&quot; class=&quot;size-medium wp-image-73 aligncenter&quot; height=&quot;76&quot; sizes=&quot;(max-width: 300px) 100vw, 300px&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/inport-export-db-300x76.png&quot; srcset=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/inport-export-db-300x76.png 300w, http://www.sandeepknarware.in/wp-content/uploads/2017/09/inport-export-db.png 476w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; width=&quot;300&quot; /&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;Import-to-Local-SQL-Server&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Import to Local SQL Server&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Once the Export has completed, you now Import it to your local machine. This works with SQL Express too, just install the BOTH x86 and x64 versions of the DAC Framework first:&amp;nbsp;&lt;a href=&quot;https://www.microsoft.com/en-us/download/details.aspx?id=45886&quot; rel=&quot;external noopener&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot; target=&quot;_blank&quot;&gt;https://www.microsoft.com/en-us/download/details.aspx?id=45886&lt;/a&gt;&lt;/div&gt;
&lt;ol style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style-image: initial; list-style-position: outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Open SQL Management Studio and Right Click on Databases and Select Import Data-tier Application&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-74 aligncenter&quot; height=&quot;173&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/import-azure-db.png&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; width=&quot;280&quot; /&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Connect to your Azure Database Export and click Next a couple of times.&lt;br /&gt;&lt;img alt=&quot;&quot; class=&quot;size-medium wp-image-75 aligncenter&quot; height=&quot;169&quot; sizes=&quot;(max-width: 300px) 100vw, 300px&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/import-azure-db-2-300x169.png&quot; srcset=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/import-azure-db-2-300x169.png 300w, http://www.sandeepknarware.in/wp-content/uploads/2017/09/import-azure-db-2.png 503w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; width=&quot;300&quot; /&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
That should be it. If it fails, make sure you install the DAC Framework as mentioned above.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If you are more comfortable with the CLI, then you can use following commands to restore a local copy Azure SQL DB on you local SQL Server.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Using msdeploy.exe&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;msdeploy.exe&lt;/code&gt;&amp;nbsp;fails to create the destination database on its own, so you need to create it manually first.&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;ol style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style-image: initial; list-style-position: outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Copy the connection string on the database properties page. Adjust it so that it contains a correct password.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Get the connection string for the destination DB.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Run&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;msdeploy.exe&lt;/code&gt;&amp;nbsp;like this:&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;c:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;verb&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;sync &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;dest&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;dbDacFx&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;destination_DB_connection_string&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;dropDestinationDatabase&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;true &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;dbDacFx&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;azure_DB_connection_string&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;includeData&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;true &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;verbose&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Using SqlPackage.exe&lt;/h3&gt;
&lt;ol style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style-image: initial; list-style-position: outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Export the azure DB to a bacpac package.&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;c:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Export &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ssn&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;azure_db_server&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;sdn&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;azure_db_name&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;su&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;user_name&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;sp&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;password&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;tf&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;file.bacpac&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
2. Import the package to a local DB.&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;sharedaddy sd-sharing-enabled&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;blockquote style=&quot;-webkit-text-stroke-width: 0px; background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px 0px 24px; orphans: 2; padding: 24px; quotes: none; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot; style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin: 24px 0px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;c:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Import &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SourceFile&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;file.bacpac&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TargetServerName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;.\SQLEXPRESS&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TargetDatabaseName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-size: 12px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CopyOfAzureDb&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/1577897483708597561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/how-to-copy-azure-sql-database-to-local.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/1577897483708597561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/1577897483708597561'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/how-to-copy-azure-sql-database-to-local.html' title='How to Copy Azure SQL Database to Local SQL Server'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-8904373967046431477</id><published>2018-07-28T15:09:00.001-07:00</published><updated>2018-07-28T15:09:26.281-07:00</updated><title type='text'>Creating Indexes with Included Columns</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;border: 0px; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
A nonclustered index can be extended by including nonkey columns in addition to the index key columns. The nonkey columns are stored at the leaf level of the index b-tree.&amp;nbsp;Indexes that include nonkey columns provide the greatest benefit when they cover the query. This means the indexes include all columns referenced by the query.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Adding nonkey columns to the index uses more disk space to store the index. In particular, adding&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varchar(max)&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;nvarchar(max)&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;varbinary(max)&lt;/span&gt;, or&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;data types as nonkey columns may significantly increase disk space requirements, because the column values are copied into the index leaf level and also remain in the table or clustered index.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Performance gains are achieved in select operations because the query optimizer can locate all the required column data within the index; the table or clustered index is not accessed. However, having too many included columns may increase the time that is required to perform insert, update, or delete operations to the underlying table or indexed view because of increased index maintenance.&lt;/div&gt;
&lt;h3 class=&quot;subHeading&quot; style=&quot;border: 0px; clear: both; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Covering a query&lt;/h3&gt;
&lt;div class=&quot;subsection&quot; style=&quot;border: 0px; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The following example creates a nonclustered index on the&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Person.Address&lt;/span&gt;&amp;nbsp;table with four included columns. The index key column is&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;PostalCode&lt;/span&gt;&amp;nbsp;and the nonkey columns are&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;AddressLine1, AddressLine2, City,&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;StateProvinceID&lt;/span&gt;.&lt;/div&gt;
&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;codeSnippetContainerCodeContainer&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_487685ad-103a-4f77-b028-8116846ab7aa&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;CREATE NONCLUSTERED INDEX IX_Address_PostalCode
ON Person.Address (PostalCode)
INCLUDE (AddressLine1, AddressLine2, City, StateProvinceID);
GO
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
This query will be covered by the index.&lt;/div&gt;
&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-2&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;codeSnippetContainerCodeContainer&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_e5b89906-8fd4-4535-b4a6-c82bf0a86990&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;SELECT AddressLine1, AddressLine2, City, StateProvinceID, PostalCode
FROM Person.Address
WHERE PostalCode BETWEEN &#39;98000&#39; and &#39;99999&#39;;
GO&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;h3 class=&quot;subHeading&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Exceeding the index size limitation&lt;/h3&gt;
&lt;div class=&quot;subsection&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In the following example, the INCLUDE clause of the CREATE INDEX statement is used to index columns that would typically exceed the 900-byte maximum key column size limitation. The&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Production.ProductReview&lt;/span&gt;&amp;nbsp;table contains these columns:&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ProductID&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(int)&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ReviewerName&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(nvarchar (50))&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Comments (nvarchar (3850))&lt;/span&gt;. These columns are frequently used in queries, but the&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Comments&lt;/span&gt;&amp;nbsp;column is too large to participate as an index key column. However, by using the&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;INCLUDE&lt;/span&gt;&amp;nbsp;clause, the&amp;nbsp;&lt;span class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Comments&lt;/span&gt;&amp;nbsp;column can be added as a nonkey column in the index.&lt;/div&gt;
&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-3&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;codeSnippetContainerCodeContainer&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_71f49174-6e6c-42e3-bacc-37fe557912f4&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;CREATE NONCLUSTERED INDEX IX_ProductReview_ProductID_ReviewerName
ON Production.ProductReview (ProductID, ReviewerName)
INCLUDE (Comments);
GO
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
This query will be covered by the index.&lt;/div&gt;
&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-4&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;codeSnippetContainerCodeContainer&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_6b069255-43e6-4b95-963f-17e322576682&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;SELECT Comments
FROM Production.ProductReview 
WHERE ProductID = 937;
GO&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/8904373967046431477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/creating-indexes-with-included-columns.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/8904373967046431477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/8904373967046431477'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/creating-indexes-with-included-columns.html' title='Creating Indexes with Included Columns'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-4348423251100687739</id><published>2018-07-28T15:02:00.001-07:00</published><updated>2018-07-28T15:02:04.172-07:00</updated><title type='text'>Web Forms, ASP.NET MVC, and ASP.NET Web Pages</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;lf-text-block lf-block&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
ASP.NET offers three frameworks for creating web applications: Web Forms, ASP.NET MVC, and ASP.NET Web Pages. All three frameworks are stable and mature, and you can create great web applications with any of them. No matter what framework you choose, you will get all the benefits and features of ASP.NET everywhere.&lt;/div&gt;
&lt;div class=&quot;lf-text-block lf-block&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Each framework targets a different development style. The one you choose depends on a combination of your programming assets (knowledge, skills, and development experience), the type of application you’re creating, and the development approach you’re comfortable with.&lt;/div&gt;
&lt;div class=&quot;lf-text-block lf-block&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Below is an overview of each of the frameworks and some ideas for how to choose between them.&lt;/div&gt;
&lt;table style=&quot;background-color: white; border-bottom-color: rgb(237, 237, 237); border-bottom-style: solid; border-collapse: collapse; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-spacing: 0px; border-top-color: initial; border-top-style: initial; border-width: 0px 0px 1px; color: #757575; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 2; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline; width: 604px;&quot;&gt;&lt;thead style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;th style=&quot;background: rgb(241, 241, 241); border: 0px; color: #636363; font-size: 11px; line-height: 2.18182; margin: 0px; padding: 7px 14px; text-align: left; text-transform: uppercase; vertical-align: baseline;&quot;&gt;&lt;/th&gt;&lt;th style=&quot;background: rgb(241, 241, 241); border: 0px; color: #636363; font-size: 11px; line-height: 2.18182; margin: 0px; padding: 7px 14px; text-align: left; text-transform: uppercase; vertical-align: baseline;&quot;&gt;IF YOU HAVE EXPERIENCE IN&lt;/th&gt;&lt;th style=&quot;background: rgb(241, 241, 241); border: 0px; color: #636363; font-size: 11px; line-height: 2.18182; margin: 0px; padding: 7px 14px; text-align: left; text-transform: uppercase; vertical-align: baseline;&quot;&gt;DEVELOPMENT STYLE&lt;/th&gt;&lt;th style=&quot;background: rgb(241, 241, 241); border: 0px; color: #636363; font-size: 11px; line-height: 2.18182; margin: 0px; padding: 7px 14px; text-align: left; text-transform: uppercase; vertical-align: baseline;&quot;&gt;EXPERTISE&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-top-color: rgb(237, 237, 237); border-top-style: solid; border-width: 1px 0px 0px; margin: 0px; padding: 7px 14px; vertical-align: baseline;&quot;&gt;Web Forms&lt;/td&gt;&lt;td style=&quot;border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-top-color: rgb(237, 237, 237); border-top-style: solid; border-width: 1px 0px 0px; margin: 0px; padding: 7px 14px; vertical-align: baseline;&quot;&gt;Win Forms, WPF, .NET&lt;/td&gt;&lt;td style=&quot;border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-top-color: rgb(237, 237, 237); border-top-style: solid; border-width: 1px 0px 0px; margin: 0px; padding: 7px 14px; vertical-align: baseline;&quot;&gt;Rapid development using a rich library of controls that encapsulate HTML markup&lt;/td&gt;&lt;td style=&quot;border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-top-color: rgb(237, 237, 237); border-top-style: solid; border-width: 1px 0px 0px; margin: 0px; padding: 7px 14px; vertical-align: baseline;&quot;&gt;Mid-Level, Advanced RAD&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-top-color: rgb(237, 237, 237); border-top-style: solid; border-width: 1px 0px 0px; margin: 0px; padding: 7px 14px; vertical-align: baseline;&quot;&gt;MVC&lt;/td&gt;&lt;td style=&quot;border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-top-color: rgb(237, 237, 237); border-top-style: solid; border-width: 1px 0px 0px; margin: 0px; padding: 7px 14px; vertical-align: baseline;&quot;&gt;Ruby on Rails, .NET&lt;/td&gt;&lt;td style=&quot;border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-top-color: rgb(237, 237, 237); border-top-style: solid; border-width: 1px 0px 0px; margin: 0px; padding: 7px 14px; vertical-align: baseline;&quot;&gt;Full control over HTML markup, code and markup separated, and easy to write tests. The best choice for mobile and single-page applications (SPA).&lt;/td&gt;&lt;td style=&quot;border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-top-color: rgb(237, 237, 237); border-top-style: solid; border-width: 1px 0px 0px; margin: 0px; padding: 7px 14px; vertical-align: baseline;&quot;&gt;Mid-Level, Advanced&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td style=&quot;border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-top-color: rgb(237, 237, 237); border-top-style: solid; border-width: 1px 0px 0px; margin: 0px; padding: 7px 14px; vertical-align: baseline;&quot;&gt;Web Pages&lt;/td&gt;&lt;td style=&quot;border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-top-color: rgb(237, 237, 237); border-top-style: solid; border-width: 1px 0px 0px; margin: 0px; padding: 7px 14px; vertical-align: baseline;&quot;&gt;Classic ASP, PHP&lt;/td&gt;&lt;td style=&quot;border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-top-color: rgb(237, 237, 237); border-top-style: solid; border-width: 1px 0px 0px; margin: 0px; padding: 7px 14px; vertical-align: baseline;&quot;&gt;HTML markup and your code together in the same file&lt;/td&gt;&lt;td style=&quot;border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: initial; border-left-style: initial; border-right-color: initial; border-right-style: initial; border-top-color: rgb(237, 237, 237); border-top-style: solid; border-width: 1px 0px 0px; margin: 0px; padding: 7px 14px; vertical-align: baseline;&quot;&gt;New, Mid-Level&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id=&quot;web-forms&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Web Forms&lt;/h3&gt;
&lt;div class=&quot;lf-text-block lf-block&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
With ASP.NET Web Forms, you can build dynamic websites using a familiar drag-and-drop, event-driven model. A design surface and hundreds of controls and components let you rapidly build sophisticated, powerful UI-driven sites with data access.&lt;/div&gt;
&lt;h3 id=&quot;mvc&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
MVC&lt;/h3&gt;
&lt;div class=&quot;lf-text-block lf-block&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that enables a clean separation of concerns and that gives you full control over markup for enjoyable, agile development. ASP.NET MVC includes many features that enable fast, TDD-friendly development for creating sophisticated applications that use the latest web standards.&lt;span class=&quot;lf-has-num lf-thread-btn&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a class=&quot;fycon-action-view&quot; href=&quot;https://www.blogger.com/null&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h3 id=&quot;aspnet-web-pages&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
ASP.NET Web Pages&lt;/h3&gt;
&lt;div class=&quot;lf-text-block lf-block&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
ASP.NET Web Pages and the Razor syntax provide a fast, approachable, and lightweight way to combine server code with HTML to create dynamic web content. Connect to databases, add video, link to social networking sites, and include many more features that help you create beautiful sites that conform to the latest web standards.&lt;/div&gt;
&lt;h3 id=&quot;notes-about-web-forms-mvc-and-web-pages&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Notes about Web Forms, MVC, and Web Pages&lt;/h3&gt;
&lt;div class=&quot;lf-text-block lf-block&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
All three ASP.NET frameworks are based on the .NET Framework and share core functionality of .NET and of ASP.NET. For example, all three frameworks offer a login security model based around membership, and all three share the same facilities for managing requests, handling sessions, and so on that are part of the core ASP.NET functionality.&lt;/div&gt;
&lt;div class=&quot;lf-text-block lf-block&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In addition, the three frameworks are not entirely independent, and choosing one does not preclude using another. Since the frameworks can coexist in the same web application, it’s not uncommon to see individual components of applications written using different frameworks. For example, customer-facing portions of an app might be developed in MVC to optimize the markup, while the data access and administrative portions are developed in Web Forms to take advantage of data controls and simple data access.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/4348423251100687739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/web-forms-aspnet-mvc-and-aspnet-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/4348423251100687739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/4348423251100687739'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/web-forms-aspnet-mvc-and-aspnet-web.html' title='Web Forms, ASP.NET MVC, and ASP.NET Web Pages'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-3808700440265537056</id><published>2018-07-28T15:00:00.002-07:00</published><updated>2018-07-28T15:00:42.804-07:00</updated><title type='text'>The 10 Most Common Mistakes That C# Developers Make</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
C# is an object oriented, strongly-typed language. The strict type checking in C#, both at compile and run times, results in the majority of typical programming errors being reported as early as possible, and their locations pinpointed quite accurately. This can save the C# programmer a lot of time, compared to tracking down the cause of puzzling errors which can occur long after the offending operation takes place in languages which are more liberal with their enforcement of type safety. &amp;nbsp;However, a lot of programmers unwittingly (or carelessly) throw away the benefits of this detection, which leads to some of the issues discussed in this post.&lt;span id=&quot;more-29&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-1-using-a-reference-like-a-value-or-vice-versa&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #1: Using a reference like a value or vice versa&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Programmers of C++, and many other languages, are accustomed to being in control of whether the values they assign to variables are simply values or are references to existing objects.&amp;nbsp;In C#, however, that decision is made by the programmer who wrote&amp;nbsp;the object, not by the programmer who instantiates the object and assigns it to a variable. &amp;nbsp;This is a common “gotcha” for newbie C# programmers.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If you don’t know whether the object you’re using is a value type or reference type, you could run into some surprises. For example:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; Point point1 = new Point(20, 30);
  Point point2 = point1;
  point2.X = 50;
  Console.WriteLine(point1.X); &amp;nbsp; &amp;nbsp; &amp;nbsp; // 20 (does this surprise you?)
  Console.WriteLine(point2.X); &amp;nbsp; &amp;nbsp; &amp;nbsp; // 50
  
  Pen pen1 = new Pen(Color.Black);
  Pen pen2 = pen1;
  pen2.Color = Color.Blue;
  Console.WriteLine(pen1.Color); &amp;nbsp; &amp;nbsp; // Blue (or does this surprise you?)
  Console.WriteLine(pen2.Color); &amp;nbsp; &amp;nbsp; // Blue
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
As you can see, both the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Point&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Pen&lt;/code&gt;&amp;nbsp;objects were created the exact same way, but the value of&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;point1&lt;/code&gt;&amp;nbsp;remained unchanged when a new&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;X&lt;/code&gt;&amp;nbsp;coordinate value was assigned to&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;point2&lt;/code&gt;, whereas the value of&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;pen1&lt;/code&gt;&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;was&lt;/em&gt;&amp;nbsp;modified when a new color was assigned to&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;pen2&lt;/code&gt;. We can therefore&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;deduce&lt;/em&gt;&amp;nbsp;that&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;point1&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;point2&lt;/code&gt;&amp;nbsp;each contain their own copy of a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Point&lt;/code&gt;&amp;nbsp;object, whereas&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;pen1&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;pen2&lt;/code&gt;&amp;nbsp;contain references to the same&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Pen&lt;/code&gt;&amp;nbsp;object.&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;But how can we know that without doing this experiment?&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The answer is to look at the definitions of the object types (which you can easily do in Visual Studio by placing your cursor over the name of the object type and pressing F12):&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  public struct Point { … }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// defines a “value” type
  public class Pen { … }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// defines a “reference” type
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
As shown above, in C#, the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;struct&lt;/code&gt;&amp;nbsp;keyword is used to define a value type, while the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/code&gt;keyword is used to define a reference type.&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;For those with a C++ background, who were lulled into a false sense of security by the many similarities between C++ and C# keywords, this behavior likely comes as a surprise that may have you asking for help from a C# tutorial.&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If you’re going to depend on some behavior which differs between value and reference types – such as the ability to pass an object as a method parameter and have that method change the state of the object – make sure that you’re dealing with the correct type of object to avoid C# problems.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-2-misunderstanding-default-values-for-uninitialized-variables&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #2: Misunderstanding default values for uninitialized variables&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In C#, value types can’t be null. By definition, value types have a value, and even uninitialized variables of value types must have a value. This is called the default value for that type. &amp;nbsp;This leads to the following, usually unexpected result when checking if a variable is uninitialized:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  class Program {
      static Point point1;
      static Pen pen1;
      static void Main(string[] args) {
          Console.WriteLine(pen1 == null); &amp;nbsp; &amp;nbsp; &amp;nbsp;// True
          Console.WriteLine(point1 == null); &amp;nbsp; &amp;nbsp;// False (huh?)
      }
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Why isn’t&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;point1&lt;/code&gt;&amp;nbsp;null? The answer is that&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Point&lt;/code&gt;&amp;nbsp;is a value type, and the default value for a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Point&lt;/code&gt;&amp;nbsp;is (0,0), not&amp;nbsp;null. Failure to recognize this is a very easy (and common) mistake to make in C#.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Many (but not all) value types have an&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IsEmpty&lt;/code&gt;&amp;nbsp;property which you can check to see if it is equal to its default value:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  Console.WriteLine(point1.IsEmpty);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// True
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
When you’re checking to see if a variable has been initialized or not, make sure you know what value an uninitialized variable of that type will have by default and don’t rely on it being null..&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-3-using-improper-or-unspecified-string-comparison-methods&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #3: Using improper or unspecified string comparison methods&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
There are many different ways to compare strings in C#.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Although many programmers use the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/code&gt;&amp;nbsp;operator for string comparison, it is actually one of the&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;least&lt;/em&gt;desirable methods to employ, primarily because it doesn’t specify explicitly in the code which type of comparison is wanted.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Rather, the preferred way to test for string equality in C# is with the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Equals&lt;/code&gt;&amp;nbsp;method:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  public bool Equals(string value);
  public bool Equals(string value, StringComparison comparisonType);
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The first method signature (i.e., without the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;comparisonType&lt;/code&gt;&amp;nbsp;parameter), is actually the same as using the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/code&gt;&amp;nbsp;operator, but has the benefit of being explicitly applied to strings. It performs an ordinal comparison of the strings, which is basically a byte-by-byte comparison. In many cases this is exactly the type of comparison you want, especially when comparing strings whose values are set programmatically, such as file names, environment variables, attributes, etc. In these cases, as long as an ordinal comparison is indeed the correct type of comparison for that situation, the only downside to using the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Equals&lt;/code&gt;&amp;nbsp;method without a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;comparisonType&lt;/code&gt;&amp;nbsp;is that somebody reading the code may not know what type of comparison you’re making.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Using the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Equals&lt;/code&gt;&amp;nbsp;method signature that includes a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;comparisonType&lt;/code&gt;&amp;nbsp;every time you compare strings, though, will not only make your code clearer, it will make you explicitly think about which type of comparison you need to make. This is a worthwhile thing to do, because even if English may not provide a whole lot of differences between ordinal and culture-sensitive comparisons, other languages provide plenty, and ignoring the possibility of other languages is opening yourself up to a lot of potential for errors down the road. &amp;nbsp;For example:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  string s = &quot;strasse&quot;;
  
  // outputs False:
  Console.WriteLine(s == &quot;straße&quot;);
  Console.WriteLine(s.Equals(&quot;straße&quot;));
  Console.WriteLine(s.Equals(&quot;straße&quot;, StringComparison.Ordinal));
  Console.WriteLine(s.Equals(&quot;Straße&quot;, StringComparison.CurrentCulture));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  Console.WriteLine(s.Equals(&quot;straße&quot;, StringComparison.OrdinalIgnoreCase));
  
  // outputs True:
  Console.WriteLine(s.Equals(&quot;straße&quot;, StringComparison.CurrentCulture));
  Console.WriteLine(s.Equals(&quot;Straße&quot;, StringComparison.CurrentCultureIgnoreCase));
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The safest practice is to always provide a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;comparisonType&lt;/code&gt;&amp;nbsp;parameter to the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Equals&lt;/code&gt;&amp;nbsp;method. Here are some basic guidelines:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;When comparing strings that were input by the user, or are to be displayed to the user, use a culture-sensitive comparison (&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CurrentCulture&lt;/code&gt;&amp;nbsp;or&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;CurrentCultureIgnoreCase&lt;/code&gt;).&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;When comparing programmatic strings, use ordinal comparison (&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Ordinal&lt;/code&gt;&amp;nbsp;or&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;OrdinalIgnoreCase&lt;/code&gt;).&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;InvariantCulture&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;InvariantCultureIgnoreCase&lt;/code&gt;&amp;nbsp;are generally not to be used except in very limited circumstances, because ordinal comparisons are more efficient. &amp;nbsp;If a culture-aware comparison is necessary, it should usually be performed against the current culture or another specific culture.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In addition to the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Equals&lt;/code&gt;&amp;nbsp;method, strings also provide the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Compare&lt;/code&gt;&amp;nbsp;method, which gives you information about the relative order of strings instead of just a test for equality. This method is preferable to the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;=&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;gt;&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;gt;=&lt;/code&gt;&amp;nbsp;operators, for the same reasons as discussed above–to avoid C# problems.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-4-using-iterative-instead-of-declarative-statements-to-manipulate-collections&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #4: Using iterative (instead of declarative) statements to manipulate collections&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In C# 3.0, the addition of Language-Integrated Query&amp;nbsp;(LINQ) to the language changed forever the way collections are queried and manipulated. &amp;nbsp;Since then, if you’re using iterative statements to manipulate collections, you didn’t use LINQ when you probably should have.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Some C# programmers don’t even know of LINQ’s existence, but fortunately that number is becoming increasingly small. Many still think, though, that because of the similarity between LINQ keywords and SQL statements, its only use is in code that queries databases.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
While database querying is&amp;nbsp;a very prevalent use of LINQ statements, they actually work over any enumerable collection (i.e., any object that implements the IEnumerable&amp;nbsp;interface). &amp;nbsp;So for example, if you had an array of Accounts, instead of writing:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  decimal total = 0;
  foreach (Account account in myAccounts) {
    if (account.Status == &quot;active&quot;) {
      total += account.Balance;
    }
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
you could just write:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  decimal total = (from account in myAccounts
                   where account.Status == &quot;active&quot;
                   select account.Balance).Sum();
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
While this is a pretty simple example of how to avoid this common C# programming problem, there are cases where a single LINQ statement can easily replace dozens of statements in an iterative loop (or nested loops) in your code. &amp;nbsp;And less code general means less opportunities for bugs to be introduced.&amp;nbsp;Keep in mind, however, there may be a trade-off in terms of performance. In performance-critical scenarios, especially where your iterative code is able to make assumptions about your collection that LINQ cannot, be sure to do a performance comparison between the two methods.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-5-failing-to-consider-the-underlying-objects-in-a-linq-statement&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #5: Failing to consider the underlying objects in a LINQ statement&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
LINQ is great for abstracting the task of manipulating collections, whether they are in-memory objects, database tables, or XML documents. &amp;nbsp;In a perfect world, you wouldn’t need to know what the underlying objects are. But the error here is assuming we live in a perfect world. &amp;nbsp;In fact, identical LINQ statements can return different results when executed on the exact same data, if that data happens to be in a different format.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
For instance, consider the following statement:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  decimal total = (from account in myAccounts
                   where account.Status == &quot;active&quot;
                   select account.Balance).Sum();
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
What happens if one of the object’s&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;account.Status&lt;/code&gt;&amp;nbsp;equals “Active” (note the capital A)? &amp;nbsp;Well, if&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;myAccounts&lt;/code&gt;&amp;nbsp;was a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;DbSet&lt;/code&gt;&amp;nbsp;object (that was set up with the default case-insensitive configuration), the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;where&lt;/code&gt;&amp;nbsp;expression would still match that element. &amp;nbsp;However, if&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;myAccounts&lt;/code&gt;&amp;nbsp;was in an in-memory array, it would not match, and would therefore yield a different result for total.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
But wait a minute. &amp;nbsp;When we talked about string comparison earlier, we saw that the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/code&gt;&amp;nbsp;operator performed an ordinal comparison of strings. So why in this case is the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/code&gt;&amp;nbsp;operator performing a case-insensitive comparison?&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;The answer is that when the underlying objects in a LINQ statement are references to SQL table data (as is the case with the Entity Framework DbSet&amp;nbsp;object in this example), the statement is converted into a T-SQL statement. Operators then follow T-SQL rules, not C# rules, so the comparison in the above case ends up being case insensitive.&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In general, even though LINQ is a helpful and consistent way to query collections of objects, in reality you still need to know whether or not your statement will be translated to something other than C# under the hood to ensure that the behavior of your code will be as expected at runtime.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-6-getting-confused-or-faked-out-by-extension-methods&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #6: Getting confused or faked out by extension methods&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
As mentioned earlier, LINQ statements work on any object that implements IEnumerable. For example, the following simple function will add up the balances on any collection of accounts:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  public decimal SumAccounts(IEnumerable&amp;lt;Account&amp;gt; myAccounts) {
      return myAccounts.Sum(a =&amp;gt; a.Balance);
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In the above code, the type of the myAccounts&amp;nbsp;parameter is declared as&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IEnumerable&amp;lt;Account&amp;gt;&lt;/code&gt;. &amp;nbsp;Since&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;myAccounts&lt;/code&gt;&amp;nbsp;references a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sum&lt;/code&gt;&amp;nbsp;method (C# uses the familiar “dot notation” to reference a method on a class or interface), we’d expect to see a method called&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sum()&lt;/code&gt;&amp;nbsp;on the definition of the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt;&amp;nbsp;interface. &amp;nbsp;However, the definition of&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt;, makes no reference to any&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sum&lt;/code&gt;&amp;nbsp;method and simply looks like this:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  public interface IEnumerable&amp;lt;out T&amp;gt; : IEnumerable {
      IEnumerator&amp;lt;T&amp;gt; GetEnumerator();
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
So where is the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sum()&lt;/code&gt;&amp;nbsp;method defined? C# is strongly typed, so if the reference to the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sum&lt;/code&gt;&amp;nbsp;method was invalid, the C# compiler would certainly flag it as an error. &amp;nbsp;We therefore know that it must exist, but where? &amp;nbsp;Moreover, where are the definitions of all the other methods that LINQ provides for querying or aggregating these collections?&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The answer is that&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sum()&lt;/code&gt;&amp;nbsp;is not a method defined on the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IEnumerable&lt;/code&gt;&amp;nbsp;interface. Rather, it is a static method (called an “extension method”) that is defined on the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;System.Linq.Enumerable&lt;/code&gt;&amp;nbsp;class:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  namespace System.Linq {
    public static class Enumerable {
      ...
      // the reference here to “this IEnumerable&amp;lt;TSource&amp;gt; source” is
      // the magic sauce that provides access to the extension method Sum
      public static decimal Sum&amp;lt;TSource&amp;gt;(this IEnumerable&amp;lt;TSource&amp;gt; source,
                                         Func&amp;lt;TSource, decimal&amp;gt; selector);
      ...
    }
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
So what makes an extension method different from any other static method and what enables us to access it in other classes?&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The distinguishing characteristic of an extension method is the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;this&lt;/code&gt;&amp;nbsp;modifier on its first parameter. This is the “magic” that identifies it to the compiler as an extension method.&amp;nbsp;The type of the parameter it modifies (in this case&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IEnumerable&amp;lt;TSource&amp;gt;&lt;/code&gt;) denotes the class or interface which will then appear to implement this method.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
(As a side point, there’s nothing magical about the similarity between the name of the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IEnumerable&lt;/code&gt;&amp;nbsp;interface and the name of the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Enumerable&lt;/code&gt;&amp;nbsp;class on which the extension method is defined. This similarity is just an arbitrary stylistic choice.)&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
With this understanding, we can also see that the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;sumAccounts&lt;/code&gt;&amp;nbsp;function we introduced above could instead have been implemented as follows:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  public decimal SumAccounts(IEnumerable&amp;lt;Account&amp;gt; myAccounts) {
      return Enumerable.Sum(myAccounts, a =&amp;gt; a.Balance);
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The fact that we could have implemented it this way instead raises the question of why have extension methods at all? &amp;nbsp;Extension methods&amp;nbsp;are essentially a convenience of the C# language that enables you to “add” methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Extension methods are brought into scope by including a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;using [namespace];&lt;/code&gt;&amp;nbsp;statement at the top of the file.&amp;nbsp;You need to know which namespace includes the extension methods you’re looking for, but that’s pretty easy to determine once you know what it is you’re searching for.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
When the C# compiler encounters a method call on an instance of an object, and doesn’t find that method defined on the referenced object class, it then looks at all extension methods that are within scope to try to find one which matches the required method signature and class.&amp;nbsp;If it finds one, it will pass the instance reference as the first argument to that extension method, then the rest of the &amp;nbsp;arguments, if any, will be passed as subsequent arguments to the extension method. &amp;nbsp;(If the C# compiler doesn’t find any corresponding extension method within scope, it will throw an error.)&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Extension methods are an example of “syntactic sugar” on the part of the C# compiler, which allows us to write code that is (usually) clearer and more maintainable. &amp;nbsp;Clearer, that is, if you’re aware of their usage. Otherwise, it can be a bit confusing, especially at first.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
While there certainly are advantages to using extension methods, they can cause problems and a cry for C# help for those developers who aren’t aware of them or don’t properly understand them. This is especially true when looking at code samples online, or at any other pre-written code. When such code &amp;nbsp;produces compiler errors (because it invokes methods that clearly aren’t defined on the classes they’re invoked on), the tendency is to think the code applies to a different version of the library, or to a different library altogether. A lot of time can be spent searching for a new version, or phantom “missing library”, that doesn’t exist.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Even developers who are familiar with extension methods still get caught occasionally, when there is a method with the same name on the object, but its method signature differs in a subtle way from that of the extension method. A lot of time can be wasted looking for a typo or error that just isn’t there.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Use of extension methods in C# libraries is becoming increasingly prevalent. &amp;nbsp;In addition to LINQ, the Unity Application Block&amp;nbsp;and the Web API framework&amp;nbsp;are examples of&amp;nbsp;two heavily-used modern libraries by Microsoft which make use of extension methods as well, and there are many others. The more modern the framework, the more likely it is that it will incorporate extension methods.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Of course, you can write your own extension methods as well. Realize, however, that while extension methods appear to get invoked just like regular instance methods, this is really just an illusion. &amp;nbsp;In particular, your extension methods can’t reference private or protected members of the class they’re extending and therefore cannot serve as a complete replacement for more traditional class inheritance.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-7-using-the-wrong-type-of-collection-for-the-task-at-hand&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #7: Using the wrong type of collection for the task at hand&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
C# provides a large variety of collection objects, with the following being only a partial list:&lt;br /&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Array&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ArrayList&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;BitArray&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;BitVector32&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dictionary&amp;lt;K,V&amp;gt;&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;HashTable&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;HybridDictionary&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;List&amp;lt;T&amp;gt;&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;NameValueCollection&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;OrderedDictionary&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Queue, Queue&amp;lt;T&amp;gt;&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SortedList&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Stack, Stack&amp;lt;T&amp;gt;&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;StringCollection&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;StringDictionary&lt;/code&gt;.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
While there can be cases where too many choices is as bad as not enough choices, that isn’t the case with collection objects. The number of options available can definitely work to your advantage. &amp;nbsp;Take a little extra time upfront to research and choose the optimal collection type for your purpose. &amp;nbsp;It will likely result in better performance and less room for error.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If there’s a collection type specifically targeted at the type of element you have (such as string or bit) lean toward using that one first. The implementation is generally more efficient when it’s targeted to a specific type of element.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
To take advantage of the type safety of C#, you should usually prefer a generic interface over a non-generic one. The elements of a generic interface are of the type you specify when you declare your object, whereas the elements of non-generic interfaces are of type object.&amp;nbsp;When using a non-generic interface, the C# compiler can’t type-check your code. Also, when dealing with collections of primitive value types, using a non-generic collection will result in repeated boxing/unboxing&amp;nbsp;of those types, which can result in a significant negative performance impact when compared to a generic collection of the appropriate type.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Another common C# problem is to write your own collection object. That isn’t to say it’s never appropriate, but with as comprehensive a selection as the one .NET offers, you can probably save a lot of time by using or extending one that already exists, rather than reinventing the wheel. &amp;nbsp;In particular, the C5 Generic Collection Library&amp;nbsp;for C# and CLI offers a wide array of additional collections “out of the box”, such as persistent tree data structures, heap based priority queues, hash indexed array lists, linked lists, and much more.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-8-neglecting-to-free-resources&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #8: Neglecting to free resources&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The CLR environment employs a garbage collector, so you don’t need to explicitly free the memory created for any object. In fact, you can’t. There’s no equivalent of the C++&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;delete&lt;/code&gt;operator&amp;nbsp;or the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;free()&lt;/code&gt;&amp;nbsp;function in C . But that doesn’t mean that you can just forget about all objects after you’re done using them. Many types of objects encapsulate some other type of system resource (e.g., a disk file, database connection, network socket, etc.). &amp;nbsp;Leaving these resources open can quickly deplete the total number of system resources, degrading performance and ultimately leading to program faults.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
While a destructor method can be defined on any C# class, the problem with destructors (also called finalizers in C#) is that you can’t know for sure when they will be called. They are called by the garbage collector (on a separate thread, which can cause additional complications) at an indeterminate time in the future. Trying to get around these limitations by forcing garbage collection with&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;GC.Collect()&lt;/code&gt;&amp;nbsp;is not a good practice, as that will block the thread for an unknown amount of time while it collects all objects eligible for collection.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
This&amp;nbsp;is not to say there are no good uses for finalizers, but freeing resources in a deterministic way isn’t one of them. Rather, when you’re operating on a file, network or database connection, you want to explicitly free the underlying resource as soon as you are done with it.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Resource leaks are a concern in almost any environment. However, C# provides a mechanism that is robust and simple to use which, if utilized, can make leaks a much rarer occurrence. The .NET framework defines the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IDisposable&lt;/code&gt;&amp;nbsp;interface, which consists solely of the&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dispose()&lt;/code&gt;&amp;nbsp;method. Any object which implements&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IDisposable&lt;/code&gt;&amp;nbsp;expects to have that method called whenever the consumer of the object is finished manipulating it. This results in explicit, deterministic freeing of resources.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If you are creating and disposing of an object within the context of a single code block, it is basically inexcusable to forget to call&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dispose()&lt;/code&gt;, because C# provides a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;using&lt;/code&gt;&amp;nbsp;statement that will ensure&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dispose()&lt;/code&gt;&amp;nbsp;gets called no matter how the code block is exited (whether it be an exception, a return statement, or simply the closing of the block). And yes, that’s the same&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;using&lt;/code&gt;&amp;nbsp;statement mentioned previously that is used to include namespaces at the top of your file. It has a second, completely unrelated purpose, which many C# developers are unaware of; namely, to ensure that&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dispose()&lt;/code&gt;&amp;nbsp;gets called on an object when the code block is exited:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  using (FileStream myFile = File.OpenRead(&quot;foo.txt&quot;)) {
    myFile.Read(buffer, 0, 100);
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
By creating a&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;using&amp;nbsp;&lt;/code&gt;block in the above example, you know for sure that&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;myFile.Dispose()&lt;/code&gt;&amp;nbsp;will be called as soon as you’re done with the file, whether or not&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Read()&lt;/code&gt;&amp;nbsp;throws an exception.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-9-shying-away-from-exceptions&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #9: Shying away from exceptions&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
C# continues its enforcement of type safety into runtime. This allows you to pinpoint errors much more quickly than in languages such as C++, where faulty type conversions can result in arbitrary values being assigned to an object’s fields. However, once again, programmers can squander this great feature,leading to C# problems. They fall into this trap because C# provides two different ways of doing things, one which can throw an exception, and one which won’t. Some will shy away from the exception route, figuring that not having to write a try/catch block saves them some coding.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
For example, here are two different ways to perform an explicit type cast in C#:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  // METHOD 1:
  // Throws an exception if account can&#39;t be cast to SavingsAccount
  SavingsAccount savingsAccount = (SavingsAccount)account;
  
  // METHOD 2:
  // Does NOT throw an exception if account can&#39;t be cast to
  // SavingsAccount; will just set savingsAccount to null instead
  SavingsAccount savingsAccount = account as SavingsAccount;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The most obvious error that could occur with the use of Method 2 would be a failure to check the return value. That would likely result in an eventual NullReferenceException, which could possibly surface at a much later time, making it much harder to track down the source of the problem. &amp;nbsp;In contrast, Method 1 would have immediately thrown an&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;InvalidCastException&lt;/code&gt;making the source of the problem much more immediately obvious.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Moreover, even if you remember to check the return value in Method 2, what are you going to do if you find it to &amp;nbsp;be null? Is the method you’re writing an appropriate place to report an error? Is there something else you can try if that cast fails? If not, then throwing an exception is the correct thing to do, so you might as well let it happen as close to the source of the problem as possible.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Here are a couple of examples of other common pairs of methods where one throws an exception and the other does not:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  int.Parse(); &amp;nbsp; &amp;nbsp; // throws exception if argument can’t be parsed
  int.TryParse(); &amp;nbsp;// returns a bool to denote whether parse succeeded
  
  IEnumerable.First(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // throws exception if sequence is empty
  IEnumerable.FirstOrDefault(); &amp;nbsp;// returns null/default value if sequence is empty
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Some programmers are so “exception adverse” that they automatically assume the method that doesn’t throw an exception is superior. &amp;nbsp;While there are certain select cases where this may be true, it is not at all correct as a generalization.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
As a specific example, in a case where you have an alternative legitimate (e.g., default) action to take if an exception would have been generated, then that the non-exception approach could be a legitimate choice. &amp;nbsp;In such a case, it may indeed be better to write something like this:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  if (int.TryParse(myString, out myInt)) {
    // use myInt
  } else {
    // use default value
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
instead of:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  try {
    myInt = int.Parse(myString);
    // use myInt
  } catch (FormatException) {
    // use default value
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
However, it is incorrect to assume that&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TryParse&lt;/code&gt;&amp;nbsp;is therefore necessarily the “better” method. &amp;nbsp;Sometimes that’s the case, sometimes it’s not. That’s why there are two ways of doing it.&amp;nbsp;Use the correct one for the context you are in, remembering that exceptions can certainly be your friend as a developer.&lt;/div&gt;
&lt;h2 id=&quot;common-mistake-10-allowing-compiler-warnings-to-accumulate&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.6; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Common Mistake #10: Allowing compiler warnings to accumulate&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
While this problem is definitely not C# specific, it is particularly egregious in C# since it abandons the benefits of the strict type checking offered by the C# compiler.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Warnings are generated for a reason. &amp;nbsp;While all C# compiler errors signify a defect in your code, many warnings do as well. What differentiates the two is that, in the case of a warning, the compiler has no problem emitting the instructions your code represents. Even so, it finds your code a little bit fishy, and there is a reasonable likelihood that your code doesn’t accurately reflect your intent.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
A common simple example for the sake of this post is when you modify your algorithm to eliminate the use of a variable you were using, but you forget to remove the variable declaration. The program will run perfectly, but the compiler will flag the useless variable declaration. The fact that the program runs perfectly causes programmers to neglect to fix the cause of the warning. Furthermore, programmers take advantage of a Visual Studio feature which makes it easy for them to hide the warnings in the “Error List” window so they can focus only on the errors. It doesn’t take long until there are dozens of warnings, all of them blissfully ignored (or even worse, hidden).&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
But if you ignore this type of warning, sooner or later, something like this may very well find its way into your code:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;border: 0px; display: block; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;  class Account {
  
      int myId;
      int Id; &amp;nbsp; // compiler warned you about this, but you didn’t listen!
  
      // Constructor
      Account(int id) {
          this.myId = Id;&amp;nbsp; &amp;nbsp; &amp;nbsp;// OOPS!
      }
  
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
And at the speed Intellisense allows us to write code, this error isn’t as improbable as it looks.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
You now have a serious error in your program (although the compiler has only flagged it as a warning, for the reasons already explained), and depending on how complex your program is, you could waste a lot of time tracking this one down. Had you paid attention to this warning in the first place, you would have avoided this problem with a simple five-second fix.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Remember, the C# compiler gives you a lot of useful information about the robustness of your code… if you’re listening. Don’t ignore warnings.&lt;/strong&gt;&amp;nbsp;They usually only take a few seconds to fix, and fixing new ones when they happen can save you hours. Train yourself to expect the Visual Studio “Error List” window to display “0 Errors, 0 Warnings”, so that any warnings at all make you uncomfortable enough to address them immediately.&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;google-auto-placed&quot; style=&quot;background-color: white; border: 0px; clear: none; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; height: auto; margin: 0px; padding: 0px; text-align: center; vertical-align: baseline; width: 604.813px;&quot;&gt;
&lt;ins class=&quot;adsbygoogle adsbygoogle-noablate&quot; data-ad-client=&quot;ca-pub-3374939295083809&quot; data-ad-format=&quot;auto&quot; data-adsbygoogle-status=&quot;done&quot; style=&quot;background: none transparent; border: 0px; display: block; height: 60px; margin: 10px auto 20px; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;&lt;ins id=&quot;aswift_5_expand&quot; style=&quot;background: none transparent; border: none; display: inline-table; height: 60px; margin: 0px; padding: 0px; position: relative; text-decoration-line: none; vertical-align: baseline; visibility: visible; width: 605px;&quot;&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 1.71429; margin: 0px 0px 20px; orphans: 2; padding: 0px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
Of course, there are exceptions to every rule. &amp;nbsp;Accordingly, there may be times when your code will look a bit fishy to the compiler, even though it is exactly how you intended it to be. In those very&amp;nbsp;rare cases, use&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;#pragma warning disable [warning id]&lt;/code&gt;&amp;nbsp;around only the code that triggers the warning, and only for the warning ID that it triggers. This will suppress that warning, and that warning only, so that you can still stay alert for new ones.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/3808700440265537056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/the-10-most-common-mistakes-that-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/3808700440265537056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/3808700440265537056'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/the-10-most-common-mistakes-that-c.html' title='The 10 Most Common Mistakes That C# Developers Make'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-2242720933870624624</id><published>2018-07-28T15:00:00.000-07:00</published><updated>2018-07-28T15:00:04.075-07:00</updated><title type='text'>Dependency Injection</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In software engineering,&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;dependency injection&lt;/b&gt;&amp;nbsp;is a software design pattern that implements inversion of control for resolving dependencies. A dependency is an&amp;nbsp;object that is&amp;nbsp;be used in a class as service. An injection is the passing of a dependency to a dependent object (a client) that would use it. The service is made part of the client’s state.&amp;nbsp;Passing the service to the client, rather than allowing a client to build or find the service, is the fundamental requirement of the pattern.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Dependency injection allows a program design to follow the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;dependency inversion principle&lt;/strong&gt;. The client delegates to external code (the injector) the responsibility of providing its dependencies. The client is not allowed to call the injector code.&amp;nbsp;It is the injecting code that constructs the services and calls the client to inject them. This means the client code does not need to know about the injecting code. The client does not need to know how to construct the services. The client does not need to know which actual services it is using. The client only needs to know about the intrinsic interfaces of the services because these define how the client may use the services. This separates the responsibilities of use and construction.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Dependency injection separates the creation of a client’s dependencies from the client’s behavior, which allows program designs to be loosely coupled&amp;nbsp;and to follow the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;dependency inversion&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;single responsibility principles&lt;/strong&gt;.&amp;nbsp;It directly contrasts with the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service locator pattern&lt;/strong&gt;, which allows clients to know about the system they use to find dependencies.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
An injection, the basic unit of dependency injection, is not a new or a custom mechanism. It works in the same way that “&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;parameter passing&lt;/strong&gt;” works.&amp;nbsp;Referring to “&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;parameter passing&lt;/strong&gt;” as an injection carries the added implication that it’s being done to isolate the client from details.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Dependency injection involves four roles:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;the&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/b&gt;&amp;nbsp;object(s) to be used&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;the&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;client&lt;/b&gt;&amp;nbsp;object that is depending on the services it uses&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;the&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;interface&amp;nbsp;&lt;/b&gt;that define how the client may use the services&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;the&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;injector&lt;/b&gt;, which is responsible for constructing the services and injecting them into the client&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Any object that may be used can be considered a&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/b&gt;. Any object that uses other objects can be considered a&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;client&lt;/b&gt;. The names have nothing to do with what the objects are for and everything to do with the role the objects play in any one injection.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;interfaces&lt;/b&gt;&amp;nbsp;are the types the client expects its dependencies to be.&amp;nbsp;hey may truly be interface types implemented by the services but also may be abstract classes.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Given that the client has no concrete knowledge, so long as the what the client uses, the interfaces name and methods, then the client won’t need to change even if what is behind the interface changes. However, if the interface is refactored from being a class to an interface type (or vice versa) the client will need to be recompiled.This is significant if the client and services are published separately. This unfortunate coupling is one that dependency injection cannot resolve.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;injector&lt;/b&gt;&amp;nbsp;introduces the services into the client. Often, it also constructs the client. An injector may connect together a very complex object graph by treating an object like a client and later as a service for another client. The injector may be referred to by other names such as: assembler, provider, container, factory, builder, spring, construction code, or main.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;mw-headline&quot; id=&quot;Advantages&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Advantages&lt;/span&gt;&lt;/h3&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Dependency injection allows a client to remove all knowledge of a concrete implementation that it needs to use. This helps isolate the client from the impact of design changes and defects. It promotes reusability, testability and maintainability.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Reduction of boilerplate code in the application objects since all work to initialize or set up dependencies is handled by a provider component.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Dependency injection allows concurrent or independent development. Two developers can independently develop classes that use each other, while only needing to know the interface the classes will communicate through. Plugins are often developed by third party shops that never even talk to the developers who created the product that uses the plugins.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Dependency Injection decreases coupling between a class and its dependency.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;mw-headline&quot; id=&quot;Disadvantages&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Disadvantages&lt;/span&gt;&lt;/h3&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Dependency injection creates clients that demand configuration details be supplied by construction code. This can be onerous when obvious defaults are available.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Dependency injection can make code difficult to trace (read) because it separates behavior from construction. This means developers must refer to more files to follow how a system performs.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Dependency injection forces complexity to move out of classes and into the linkages between classes which might not always be desirable or easily managed.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Ironically, dependency injection can encourage dependence on a dependency injection framework.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In the following C#&amp;nbsp;example, the Client class contains a Service member variable that is initialized by the Client constructor. The client controls which implementation of service is used and controls its construction. In this situation, the client is said to have a hard-coded dependency on ServiceExample.&lt;/div&gt;
&lt;pre style=&quot;background-color: white; border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// An example without dependency injection&lt;/span&gt;
&lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Client&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Internal reference to the service used by this client&lt;/span&gt;
    &lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Service&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Constructor&lt;/span&gt;
    public &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Specify a specific implementation in the constructor 
        //instead of using dependency injection&lt;/span&gt;
        &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ServiceExample&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Method within this client that uses the services&lt;/span&gt;
    &lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;greet&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Hello &quot;&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}
&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dependency injection is an alternative technique to initialize the member variable rather than explicitly creating a service object as shown above.&lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;mw-headline&quot; id=&quot;Three_types_of_dependency_injection&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Three types of dependency injection&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
There are at least three ways an object can receive a reference to an external module:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;i style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;constructor injection&lt;/i&gt;: the dependencies are provided through a class constructor.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;i style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;property&amp;nbsp;injection&lt;/i&gt;: the client exposes a property&amp;nbsp;that the injector uses to inject the dependency.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;i style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;interface injection&lt;/i&gt;: the dependency provides an injector method that will inject the dependency into any client passed to it. Clients must implement an interface that exposes a property&amp;nbsp;that accepts the dependency.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;mw-headline&quot; id=&quot;Constructor_injection&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Constructor injection&lt;/span&gt;&lt;/h4&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
This method requires the client to provide a parameter in a constructor for the dependency.&lt;/div&gt;
&lt;div class=&quot;mw-highlight mw-content-ltr&quot; dir=&quot;ltr&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Constructor&lt;/span&gt;
&lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Service&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Save the reference to the passed-in service inside this client&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;h4 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;mw-headline&quot; id=&quot;Setter_injection&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Setter injection&lt;/span&gt;&lt;/h4&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
This method requires the client to provide a property&amp;nbsp;for each dependency.&lt;/div&gt;
&lt;div class=&quot;mw-highlight mw-content-ltr&quot; dir=&quot;ltr&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Property&lt;/span&gt;
&lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;setService&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Service&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Save the reference to the passed-in service inside this client&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;h4 style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.84615; margin: 24px 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;mw-headline&quot; id=&quot;Interface_injection&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Interface injection&lt;/span&gt;&lt;/h4&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
This is simply the client publishing a role interface to the property&amp;nbsp;of the client’s dependencies. It can be used to establish how the injector should talk to the client when injecting dependencies.&lt;/div&gt;
&lt;div class=&quot;google-auto-placed&quot; style=&quot;background-color: white; border: 0px; clear: none; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; height: auto; margin: 0px; padding: 0px; text-align: center; vertical-align: baseline; width: 604.813px;&quot;&gt;
&lt;ins class=&quot;adsbygoogle adsbygoogle-noablate&quot; data-ad-client=&quot;ca-pub-3374939295083809&quot; data-ad-format=&quot;auto&quot; data-adsbygoogle-status=&quot;done&quot; style=&quot;background: none transparent; border: 0px; display: block; height: 60px; margin: 10px auto 20px; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;&lt;ins id=&quot;aswift_5_expand&quot; style=&quot;background: none transparent; border: none; display: inline-table; height: 60px; margin: 0px; padding: 0px; position: relative; text-decoration-line: none; vertical-align: baseline; visibility: visible; width: 605px;&quot;&gt;&lt;ins id=&quot;aswift_5_anchor&quot; style=&quot;background: none transparent; border: none; display: block; height: 60px; margin: 0px; padding: 0px; position: relative; text-decoration-line: none; vertical-align: baseline; visibility: visible; width: 605px;&quot;&gt;&lt;iframe allowfullscreen=&quot;true&quot; allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;60&quot; hspace=&quot;0&quot; id=&quot;aswift_5&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_5&quot; scrolling=&quot;no&quot; style=&quot;border-style: initial; border-width: 0px; height: 60px; left: 0px; margin: 0px 0px 2px; max-width: 100%; padding: 0px; position: absolute; top: 0px; vertical-align: baseline; width: 605px;&quot; vspace=&quot;0&quot; width=&quot;605&quot;&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;
&lt;div class=&quot;mw-highlight mw-content-ltr&quot; dir=&quot;ltr&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Service interface.&lt;/span&gt;
&lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;nc&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ServiceSetter&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;setService&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Service&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Client class&lt;/span&gt;
&lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Client&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ServiceSetter&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Internal reference to the service used by this client.&lt;/span&gt;
    &lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Service&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;c1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Set the service that this client is to use.&lt;/span&gt;
    &lt;span class=&quot;nd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;@Override&lt;/span&gt;
    &lt;span class=&quot;kd&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;setService&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Service&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/2242720933870624624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/dependency-injection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/2242720933870624624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/2242720933870624624'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/dependency-injection.html' title='Dependency Injection'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-9101354192202070566</id><published>2018-07-28T14:59:00.002-07:00</published><updated>2018-07-28T14:59:28.314-07:00</updated><title type='text'>What is the default Capacity of List(Stack, Queue)?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Under the hood Lists (Stacks and Queues) rely on array to store their items. Whenever we create a empty list the default capacity of the list will be 0. At this time the underline array will be empty. In the code below we are creating an empty list and then we are writing its capacity in console.&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
List&amp;lt;int&amp;gt; number = new List&amp;lt;int&amp;gt;();&lt;br /&gt;Console.WriteLine(number.Capacity);&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The code returns 0. Now lets add an item to the list.&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
List&amp;lt;int&amp;gt; number = new List&amp;lt;int&amp;gt;();&lt;br /&gt;number.Add(10);&lt;br /&gt;Console.WriteLine(number.Capacity);&lt;br /&gt;Console.ReadLine();&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If we run this code it shows 4 as capacity, but we added only 1 item then why we are getting 4 as capacity?&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Actually, it starts with a Capacity of 0. When you add the first element, the current implementation allocates a capacity of 4. After that, the capacity keeps doubling if expansion is needed, to guarantee amortized O(1) operation.&amp;nbsp;Code below should demonstrate the current behavior&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: 0px; font-family: Consolas, Monaco, monospace; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;List&amp;lt;int&amp;gt; list = new List&amp;lt;int&amp;gt;();&lt;br /&gt;int capacity = list.Capacity;&lt;br /&gt;Console.WriteLine(“Capacity: ” + capacity);&lt;br /&gt;for (int i = 0; i &amp;lt; 100000; i++)&lt;br /&gt;{&lt;br /&gt;list.Add(i);&lt;br /&gt;if (list.Capacity &amp;gt; capacity)&lt;br /&gt;{&lt;br /&gt;capacity = list.Capacity;&lt;br /&gt;Console.WriteLine(“Capacity: ” + capacity);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Console.ReadLine();&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In simpler words whenever we add first element in the list, framework creates an array of size 4 and use it to store list’s elements. As soon as we add 5th element in the list framework create another array of size 8, copy all 4 list elements from the old array to new array and then add new element to the new array. Now when we add 9th element framework creates and new array of size 16 and copy elements from older array to new array and add newly added element. This creation of new array and copying of older elements keep repeating whenever we reach the size of underline array. All this operation require time and operation and hits performance.&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;It is a good idea to initialize a list with required capacity in advance, if we know how many Items we need to store in a list .&lt;/strong&gt;&amp;nbsp;So, if you know that you may have from, say, 50 to 60 items in your list, create a list with capacity 60 and no memory deallocation will happen and&amp;nbsp;Garbage Collector will not have to clean up old arrays.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/9101354192202070566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/what-is-default-capacity-of-liststack.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/9101354192202070566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/9101354192202070566'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/what-is-default-capacity-of-liststack.html' title='What is the default Capacity of List(Stack, Queue)?'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-4916109095985612429</id><published>2018-07-28T14:59:00.000-07:00</published><updated>2018-07-28T14:59:04.008-07:00</updated><title type='text'>How to allow a very large object in .net application?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Since .NET 1.0 the memory limit of .NET object is 2GB. This means you cannot for example create array which contains elements with more than 2GB in total. If try to create such array, you will get the OutOfMemoryException.&lt;br /&gt;Let’s see an example how to produce OutOfMemoryException.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Before that Open Visual Studio, and create C# Console Application. Lets create simple struct with two double members like example below:&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
public struct ComplexNumber {&lt;br /&gt;public double Re;&lt;br /&gt;public double Im;&lt;/div&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
public ComplexNumber(double re, double im) {&lt;br /&gt;Re = re;&lt;br /&gt;Im = im;&lt;br /&gt;}&lt;br /&gt;}&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
As we know this structure consumes about 16 bytes of memory. So if we want to create array of this type which consume more than 2GB we need to create array at least with 134217728 instances. So this sample program below creates 130000000 (about 1,97 GB) of array.&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
int maxCount = 130000000;&lt;br /&gt;ComplexNumber[] arr = null;&lt;br /&gt;try {&lt;br /&gt;arr = new ComplexNumber[maxCount];&lt;br /&gt;} catch (Exception ex) {&lt;br /&gt;Console.WriteLine(ex.Message);&lt;br /&gt;}&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
So if we run this sample program the output will be like picture below:&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;size-medium wp-image-113 aligncenter&quot; height=&quot;152&quot; sizes=&quot;(max-width: 300px) 100vw, 300px&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl1-300x152.png&quot; srcset=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl1-300x152.png 300w, http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl1.png 604w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; width=&quot;300&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Let’s try to create 140000000 instances. This is about 2.08 GB. The output produces exception:&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;size-medium wp-image-114 aligncenter&quot; height=&quot;152&quot; sizes=&quot;(max-width: 300px) 100vw, 300px&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl3-300x152.png&quot; srcset=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl3-300x152.png 300w, http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl3.png 604w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; width=&quot;300&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The new feature of .NET 4.5 allows to create object beyond this magical number. To enable creation of object more than 2 GB, you only need to set proper variable in configuration file. The new gcAllowVeryLargeObjects&lt;br /&gt;Element enables creation of array that are greater than 2 gigabytes (GB) in total size on 64 bit platform. So the following configuration file allows us to create more that 140000000 instances of our sample.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;size-medium wp-image-115 aligncenter&quot; height=&quot;164&quot; sizes=&quot;(max-width: 300px) 100vw, 300px&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl41-300x164.png&quot; srcset=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl41-300x164.png 300w, http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl41.png 604w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; width=&quot;300&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Now,If we run our sample the output is:&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;size-medium wp-image-116 aligncenter&quot; height=&quot;152&quot; sizes=&quot;(max-width: 300px) 100vw, 300px&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl5-300x152.png&quot; srcset=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl5-300x152.png 300w, http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl5.png 604w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; width=&quot;300&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Ok how about to create more than 3GB of instances. For that propose, we need to create at least 201326592 instances. If we include this number in our sample the output is:&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;size-medium wp-image-118 aligncenter&quot; height=&quot;152&quot; sizes=&quot;(max-width: 300px) 100vw, 300px&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl6-300x152.png&quot; srcset=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl6-300x152.png 300w, http://www.sandeepknarware.in/wp-content/uploads/2017/09/largearraysl6.png 604w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; width=&quot;300&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Be careful with this feature, because it will suck all your computer memory.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
This feature works only with 64bit OS, it will not work with 32 bit.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Before you use this feature please see official&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/hh285054(v=vs.110).aspx&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;description&lt;/a&gt;, because it contains some limitation which you must know before you use.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/4916109095985612429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/how-to-allow-very-large-object-in-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/4916109095985612429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/4916109095985612429'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/how-to-allow-very-large-object-in-net.html' title='How to allow a very large object in .net application?'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-447190866327114165</id><published>2018-07-28T14:58:00.004-07:00</published><updated>2018-07-28T14:58:31.014-07:00</updated><title type='text'>When to use Static Constructor?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
A static constructor is used to initialize any static data, or to perform a particular action that needs to be performed once only. It is called automatically before the first instance is created or any static members are referenced.&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 24px; margin-top: 24px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;class SimpleClass
{
    // Static variable that must be initialized at run time.&amp;nbsp;
    static&amp;nbsp;readonly&amp;nbsp;long baseline;

    // Static constructor is called at most one time, before any&amp;nbsp;
    // instance constructor is invoked or member is accessed.&amp;nbsp;
    static SimpleClass()
    {
        baseline = DateTime.Now.Ticks;
    }
}

&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Static constructors have the following properties:&lt;/strong&gt;&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style: square outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;A static constructor does not take access modifiers or have parameters.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;A static constructor is called automatically to initialize the class before the first instance is created or any static members are referenced.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;A static constructor cannot be called directly.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;The user has no control on when the static constructor is executed in the program.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;A typical use of static constructors is when the class is using a log file and the constructor is used to write entries to this file.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Static constructors are also useful when creating wrapper classes for unmanaged code, when the constructor can call the LoadLibrary method.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;If a static constructor throws an exception, the runtime will not invoke it a second time, and the type will remain uninitialized for the lifetime of the application domain in which your program is running.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
In the example below, class Bus has a static constructor. When the first instance of Bus is created (bus1), the static constructor is invoked to initialize the class. The sample output verifies that the static constructor runs only one time, even though two instances of Bus are created, and that it runs before the instance constructor runs.&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;sharedaddy sd-sharing-enabled&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;blockquote style=&quot;-webkit-text-stroke-width: 0px; background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px 0px 24px; orphans: 2; padding: 24px; quotes: none; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;pre style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin: 24px 0px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;public&amp;nbsp;class Bus
    {
        // Static variable used by all Bus instances.&amp;nbsp;
        // Represents the time the first bus of the day starts its route.&amp;nbsp;
        protected&amp;nbsp;static&amp;nbsp;readonly DateTime globalStartTime;

        // Property for the number of each bus.&amp;nbsp;
        protected&amp;nbsp;int RouteNumber { get; set; }

        // Static constructor to initialize the static variable.&amp;nbsp;
        // It is invoked before the first instance constructor is run.&amp;nbsp;
        static Bus()
        {
            globalStartTime = DateTime.Now;

            // The following statement produces the first line of output, &amp;nbsp;
            // and the line occurs only once.
            Console.WriteLine(&quot;Static constructor sets global start time to {0}&quot;,
                globalStartTime.ToLongTimeString());
        }

        // Instance constructor.&amp;nbsp;
        public Bus(int routeNum)
        {
            RouteNumber = routeNum;
            Console.WriteLine(&quot;Bus #{0} is created.&quot;, RouteNumber);
        }

        // Instance method.&amp;nbsp;
        public&amp;nbsp;void Drive()
        {
            TimeSpan elapsedTime = DateTime.Now - globalStartTime;

            // For demonstration purposes we treat milliseconds as minutes to simulate&amp;nbsp;
            // actual bus times. Do not do this in your actual bus schedule program!
            Console.WriteLine(&quot;{0} is starting its route {1:N2} minutes after global start time {2}.&quot;,
                                    this.RouteNumber,
                                    elapsedTime.TotalMilliseconds,
                                    globalStartTime.ToShortTimeString());
        }
    }

    class TestBus
    {
        static&amp;nbsp;void Main()
        {
            // The creation of this instance activates the static constructor.
            Bus bus1 = new Bus(71);

            // Create a second bus.
            Bus bus2 = new Bus(72);

            // Send bus1 on its way.
            bus1.Drive();

            // Wait for bus2 to warm up.
            System.Threading.Thread.Sleep(25);

            // Send bus2 on its way.
            bus2.Drive();

            // Keep the console window open in debug mode.
            System.Console.WriteLine(&quot;Press any key to exit.&quot;);
            System.Console.ReadKey();
        }
    }
    /* Sample output:
        Static constructor sets global start time to 3:57:08 PM.
        Bus #71 is created.
        Bus #72 is created.
        71 is starting its route 6.00 minutes after global start time 3:57 PM.
        72 is starting its route 31.00 minutes after global start time 3:57 PM.      
   */&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/447190866327114165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/when-to-use-static-constructor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/447190866327114165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/447190866327114165'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/when-to-use-static-constructor.html' title='When to use Static Constructor?'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-7375481304850128199</id><published>2018-07-28T14:58:00.002-07:00</published><updated>2018-07-28T14:58:02.673-07:00</updated><title type='text'>Create, Edit, Update Excel Sheets on Sever</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
You need to have Microsoft Excel installed on you web server if you are using&amp;nbsp;Microsoft.Office.Interop.Excel. But its not always possible to install Microsoft Excel on your web server.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
There is a small library named&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;EPPlus&lt;/strong&gt;&amp;nbsp;which you can use to create, edit and update excel sheets on server. its available on&amp;nbsp;&lt;a href=&quot;http://epplus.codeplex.com/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;codeplex&lt;/a&gt;&amp;nbsp;as well as on&amp;nbsp;&lt;a href=&quot;https://www.nuget.org/packages/EPPlus/&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;nuget&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Here is the sample code to write a excel file on server&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;sharedaddy sd-sharing-enabled&quot; style=&quot;background-color: white; border: 0px; clear: both; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;blockquote style=&quot;-webkit-text-stroke-width: 0px; background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px 0px 24px; orphans: 2; padding: 24px; quotes: none; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;pre style=&quot;border-radius: 20px; border: 1px solid rgb(237, 237, 237); color: #666666; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin: 24px 0px; overflow: auto; padding: 24px; vertical-align: baseline;&quot;&gt;private void DumpExcel(DataTable tbl)
        {
            using (ExcelPackage pck = new ExcelPackage())
            {
                //Create the worksheet
                ExcelWorksheet ws = pck.Workbook.Worksheets.Add(&quot;Demo&quot;);

                //Load the datatable into the sheet, starting from cell A1. Print the column names on row 1
                ws.Cells[&quot;A1&quot;].LoadFromDataTable(tbl, true);

                //Format the header for column 1-3
                using (ExcelRange rng = ws.Cells[&quot;A1:C1&quot;])
                {
                    rng.Style.Font.Bold = true;
                    rng.Style.Fill.PatternType = ExcelFillStyle.Solid;                      //Set Pattern for the background to Solid
                    rng.Style.Fill.BackgroundColor.SetColor(Color.FromArgb(79, 129, 189));  //Set color to dark blue
                    rng.Style.Font.Color.SetColor(Color.White);
                }

                //Example how to Format Column 1 as numeric 
                using (ExcelRange col = ws.Cells[2, 1, 2 + tbl.Rows.Count, 1])
                {
                    col.Style.Numberformat.Format = &quot;#,##0.00&quot;;
                    col.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right;
                }

                //Write it back to the client
                Response.ContentType = &quot;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet&quot;;
                Response.AddHeader(&quot;content-disposition&quot;, &quot;attachment;  filename=ExcelDemo.xlsx&quot;);
                Response.BinaryWrite(pck.GetAsByteArray());
            }
        }

&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/7375481304850128199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/create-edit-update-excel-sheets-on-sever.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/7375481304850128199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/7375481304850128199'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/create-edit-update-excel-sheets-on-sever.html' title='Create, Edit, Update Excel Sheets on Sever'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-701053865096044705</id><published>2018-07-28T14:57:00.001-07:00</published><updated>2018-07-28T14:57:30.091-07:00</updated><title type='text'>How to use Azure AD Authentication in web application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
When you want to use Azure Active Directory Authentication in your web application, you have two choices. One when you create your application that time itself you can provide the organization details and Visual Studio will do the rest of the work for you. In background Visual Studio will create application registration for your newly created application. Below image shows where you can provide your organization details when you create a new application in Visual Studio&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;aligncenter wp-image-179 size-full&quot; height=&quot;515&quot; sizes=&quot;(max-width: 789px) 100vw, 789px&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/11/NewProject.png&quot; srcset=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/11/NewProject.png 789w, http://www.sandeepknarware.in/wp-content/uploads/2017/11/NewProject-300x196.png 300w, http://www.sandeepknarware.in/wp-content/uploads/2017/11/NewProject-768x501.png 768w, http://www.sandeepknarware.in/wp-content/uploads/2017/11/NewProject-660x431.png 660w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; width=&quot;789&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
When you click on change authentication option you will be asked to provide you azure account details as shown below.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;aligncenter wp-image-178 size-full&quot; height=&quot;364&quot; sizes=&quot;(max-width: 723px) 100vw, 723px&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/11/ChangeAuthentication.png&quot; srcset=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/11/ChangeAuthentication.png 723w, http://www.sandeepknarware.in/wp-content/uploads/2017/11/ChangeAuthentication-300x151.png 300w, http://www.sandeepknarware.in/wp-content/uploads/2017/11/ChangeAuthentication-660x332.png 660w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; width=&quot;723&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
When you click on the OK button. Visual Studio will do all the magic and it will create web application solution which will have all the configuration done already. You can simple build the application and run, you will be redirected to you organizations AD page where you need to provide your credentials and then you will be able to login to your application.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
But in most of the cases you will have to add Azure Active Directory Authentication in the existing application. In that case you can use connected services dialog to configure Azure Active Directory using following steps&lt;/div&gt;
&lt;ol class=&quot;lf-text-block lf-block&quot; data-lf-anchor-id=&quot;cfc42c69ddb966fc3b09f8c747074f51:0&quot; style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; list-style-image: initial; list-style-position: outside; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;In Visual Studio, create or open an ASP.NET MVC project, or an ASP.NET Web API project.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;From the Solution Explorer, right-click the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Connected Services&lt;/strong&gt;&amp;nbsp;node, and, from the context menu, select&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Add Connected Services&lt;/strong&gt;.&lt;img alt=&quot;&quot; class=&quot;aligncenter wp-image-180 size-full&quot; height=&quot;447&quot; sizes=&quot;(max-width: 270px) 100vw, 270px&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/11/ConnectedServices.png&quot; srcset=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/11/ConnectedServices.png 270w, http://www.sandeepknarware.in/wp-content/uploads/2017/11/ConnectedServices-181x300.png 181w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; width=&quot;270&quot; /&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;On the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Connected Services&lt;/strong&gt;&amp;nbsp;page, select&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Authentication with Azure Active Directory&lt;/strong&gt;.&lt;img alt=&quot;Connected Services page&quot; class=&quot;aligncenter&quot; data-linktype=&quot;relative-path&quot; src=&quot;https://docs.microsoft.com/en-us/azure/media/vs-azure-tools-connected-services-add-active-directory/connected-services-add-active-directory.png&quot; style=&quot;border: 0px; display: block; height: auto; margin: 12px auto; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; /&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;On the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Introduction&lt;/strong&gt;&amp;nbsp;page of the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Configure Azure AD Authentication&lt;/strong&gt;wizard, select&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Next&lt;/strong&gt;.&lt;img alt=&quot;Introduction page&quot; data-linktype=&quot;relative-path&quot; src=&quot;https://docs.microsoft.com/en-us/azure/media/vs-azure-tools-connected-services-add-active-directory/configure-azure-ad-wizard-1.png&quot; style=&quot;border: 0px; margin: 0px 0px 10px; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; /&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;On the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Single-Sign On&lt;/strong&gt;&amp;nbsp;page of the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Configure Azure AD Authentication&lt;/strong&gt;wizard, select a domain from the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Domain&lt;/strong&gt;&amp;nbsp;drop-down list. The list of domains contains all domains accessible by the accounts listed in the Account Settings dialog. As an alternative, you can enter a domain name if you don’t find the one you’re looking for, such as&amp;nbsp;&lt;code style=&quot;border: 0px; font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 2; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;mydomain.onmicrosoft.com&lt;/code&gt;. You can choose the option to create an Azure Active Directory app or use the settings from an existing Azure Active Directory app. Select&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Next&lt;/strong&gt;&amp;nbsp;when done.&lt;img alt=&quot;Single-sign on page&quot; data-linktype=&quot;relative-path&quot; src=&quot;https://docs.microsoft.com/en-us/azure/media/vs-azure-tools-connected-services-add-active-directory/configure-azure-ad-wizard-2.png&quot; style=&quot;border: 0px; margin: 0px 0px 10px; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; /&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;On the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Directory Access&lt;/strong&gt;&amp;nbsp;page of the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Configure Azure AD Authentication&lt;/strong&gt;&amp;nbsp;wizard, ensure that the&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Read directory data&lt;/strong&gt;&amp;nbsp;option is checked.&lt;img alt=&quot;Directory access page&quot; data-linktype=&quot;relative-path&quot; src=&quot;https://docs.microsoft.com/en-us/azure/media/vs-azure-tools-connected-services-add-active-directory/configure-azure-ad-wizard-3.png&quot; style=&quot;border: 0px; margin: 0px 0px 10px; max-width: 100%; padding: 0px; vertical-align: baseline;&quot; /&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Select&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Finish&lt;/strong&gt;&amp;nbsp;to add the necessary configuration code and references to enable your project for Azure AD authentication. You can see the Active Directory domain on the&amp;nbsp;Azure portal.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px 0px 0px 36px; padding: 0px; vertical-align: baseline;&quot;&gt;Visual Studio will display a&amp;nbsp;&lt;a data-linktype=&quot;self-bookmark&quot; href=&quot;https://docs.microsoft.com/en-us/azure/vs-azure-tools-connected-services-add-active-directory#how-your-project-is-modified&quot; style=&quot;border: 0px; color: #0b91ea; margin: 0px; outline: none; padding: 0px; text-decoration-line: none; vertical-align: baseline;&quot;&gt;What Happened&lt;/a&gt;&amp;nbsp;article to show you how your project was modified. If you want to check that everything worked, open one of the modified configuration files and verify that the settings mentioned in the article are there.&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
If you want to do Azure Active Directory configuration in the existing application without using connected services dialog box you can refer another post (link) which explain it.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/701053865096044705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/how-to-use-azure-ad-authentication-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/701053865096044705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/701053865096044705'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/how-to-use-azure-ad-authentication-in.html' title='How to use Azure AD Authentication in web application'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-3761230936219339544</id><published>2018-07-28T14:56:00.006-07:00</published><updated>2018-07-28T14:56:58.828-07:00</updated><title type='text'>What is an in parameter in C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
C# 7.2 adds the&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp;in&lt;/strong&gt;&amp;nbsp;&lt;/em&gt;keyword to complement the existing&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ref&lt;/strong&gt;&amp;nbsp;&lt;/em&gt;and&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;out&lt;/strong&gt;&amp;nbsp;&lt;/em&gt;keywords when you write a method that passes arguments by reference. The&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;keyword specifies that you are passing the parameter by reference and the called method does not modify the value passed to it.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
This addition provides a full vocabulary to express your design intent. Value types are copied when passed to a called method when you do not specify any of the following modifiers. Each of these modifiers specify that a value type is passed by reference, avoiding the copy. Each modifier expresses a different intent:&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;out&lt;/strong&gt;&lt;/em&gt;: This method sets the value of the argument used as this parameter.&lt;br /&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ref&lt;/em&gt;:&lt;/strong&gt;&amp;nbsp;This method may set the value of the argument used as this parameter.&lt;br /&gt;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&lt;/em&gt;: This method does not modify the value of the argument used as this parameter.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
When you add the&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;modifier to pass an argument by reference, you declare your design intent is to pass arguments by reference to avoid unnecessary copying. You do not intend to modify the object used as that argument. The following code shows an example of a method that calculates the distance between two points in 3D space.&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
private static double CalculateDistance(in Point3D point1, in Point3D point2)&lt;br /&gt;{&lt;br /&gt;double xDifference = point1.X – point2.X;&lt;br /&gt;double yDifference = point1.Y – point2.Y;&lt;br /&gt;double zDifference = point1.Z – point2.Z;&lt;/div&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
return Math.Sqrt(xDifference * xDifference + yDifference * yDifference + zDifference * zDifference);&lt;br /&gt;}&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The arguments are two structures that each contain three doubles. A double is 8 bytes, so each argument is 24 bytes. By specifying the&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;modifier, you pass 4-byte or 8-byte reference to those arguments, depending on the architecture of the machine. The difference in size is small, but it can quickly add up when your application calls this method in a tight loop using many different values.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;modifier complements&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;out&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;and&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ref&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;in other ways as well. You cannot create overloads of a method that differ only in the presence of&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/em&gt;&lt;/strong&gt;,&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;out&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;or&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ref&lt;/strong&gt;&lt;/em&gt;. These new rules extend the same behavior that had always been defined for out and ref parameters.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&amp;nbsp;&lt;/em&gt;modifier may be applied to any member that takes parameters: methods, delegates, lambdas, local functions, indexers, operators.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
Unlike&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ref&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;and&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;out&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;arguments, you may use literal values or constants for the argument to an&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&lt;/em&gt;parameter. Also, unlike a&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;ref&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;or&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;out&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;parameter, you don’t need to apply the&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;modifier at the call site. The following code shows you two examples of calling the CalculateDistance method. The first uses two local variables passed by reference. The second includes a temporary variable created as part of the method call.&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
var distance = CalculateDistance(pt1, pt2);&lt;br /&gt;var fromOrigin = CalculateDistance(pt1, new Point3D());&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
There are several ways in which the compiler ensures that the read-only nature of an&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&lt;/em&gt;argument is enforced. First of all, the called method can’t directly assign to an&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&amp;nbsp;&lt;/em&gt;parameter. It can’t directly assign to any field of an in parameter. In addition, you cannot pass an&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&lt;/em&gt;parameter to any method demanding the ref or out modifier. The compiler enforces that the&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&lt;/em&gt;argument is a readonly variable. You can call any instance method that uses pass-by-value semantics. In those instances, a copy of the&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;parameter is created. Because the compiler can create a temporary variable for any&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&amp;nbsp;&lt;/em&gt;parameter, you can also specify default values for any in parameter. The follow code uses that to specify the origin (point 0,0) as the default value for the second point:&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(250, 250, 250); border-bottom-color: initial; border-bottom-style: initial; border-image: initial; border-left-color: rgb(214, 214, 214); border-left-style: solid; border-radius: 14px; border-right-color: rgb(214, 214, 214); border-right-style: solid; border-top-color: initial; border-top-style: initial; border-width: 0px 4px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; margin: 0px 0px 24px; padding: 24px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
private static double CalculateDistance2(in Point3D point1, in Point3D point2 = default)&lt;br /&gt;{&lt;br /&gt;double xDifference = point1.X – point2.X;&lt;br /&gt;double yDifference = point1.Y – point2.Y;&lt;br /&gt;double zDifference = point1.Z – point2.Z;&lt;/div&gt;
&lt;div style=&quot;border: 0px; line-height: 1.71429; padding: 0px; vertical-align: baseline;&quot;&gt;
return Math.Sqrt(xDifference * xDifference + yDifference * yDifference + zDifference * zDifference);&lt;br /&gt;}&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Ubuntu, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.71429; margin-bottom: 20px; padding: 0px; vertical-align: baseline;&quot;&gt;
The&amp;nbsp;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;in&lt;/strong&gt;&amp;nbsp;&lt;/em&gt;parameter designation can also be used with reference types or built in numeric values. However, the benefits in both cases are minimal, if any.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/3761230936219339544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/what-is-in-parameter-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/3761230936219339544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/3761230936219339544'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/what-is-in-parameter-in-c.html' title='What is an in parameter in C#'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-4985598780451834436</id><published>2018-07-28T14:56:00.004-07:00</published><updated>2018-07-28T14:56:28.517-07:00</updated><title type='text'>What is private protected access modifier</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Finally, with C# 7.2 we get a new compound access modifier: &lt;em&gt;&lt;strong&gt;private protected&lt;/strong&gt;&lt;/em&gt; indicates that a member may be accessed by derived classes that are declared in the same assembly. While protected internal allows access by derived classes or classes that are in the same assembly, private protected limits access to derived types declared in the same assembly&lt;br /&gt;
With this now we have&amp;nbsp;following six accessibility levels that can be specified using the access modifiers:&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;public&lt;/strong&gt;&lt;/em&gt;: Access is not restricted.&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;protected&lt;/strong&gt;&lt;/em&gt;: Access is limited to the containing class or types derived from the containing class.&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;internal&lt;/strong&gt;&lt;/em&gt;: Access is limited to the current assembly.&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;protected internal&lt;/strong&gt;&lt;/em&gt;: Access is limited to the current assembly or types derived from the containing class.&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;private&lt;/strong&gt;&lt;/em&gt;: Access is limited to the containing type.&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;private protected&lt;/strong&gt;&lt;/em&gt;: Access is limited to the containing class or types derived from the containing class within the current assembly.&lt;br /&gt;
&lt;div class=&quot;lf-text-block lf-block&quot; data-lf-anchor-id=&quot;89d6ec6f8499a0d1210da0c7f500613d:0&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/4985598780451834436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/what-is-private-protected-access.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/4985598780451834436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/4985598780451834436'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/what-is-private-protected-access.html' title='What is private protected access modifier'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4406100039163587256.post-5131911139433877101</id><published>2018-07-28T14:56:00.001-07:00</published><updated>2018-07-28T14:56:05.982-07:00</updated><title type='text'>Stored procedure returns int instead of result set</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I had a Stored Procedure created in Azure Sql DB and wanted to use it in Entity Framework. Stored Procedures was returning a data set in Sql Server Management Studio but when updated my edmx file and tried to call it from C# code, it was returning a int instead of the result set I was expecting. I found number of users were facing this issue and most of the solutions on net were not working. After spending some 30 minutes I found the solution. In this post I will try to explain the solution steps by step.&lt;br /&gt;
&lt;strong&gt;Step 1:&lt;/strong&gt; We need to add&amp;nbsp;&lt;em&gt;&lt;strong&gt;SET FMTONLY OFF;&amp;nbsp;&lt;/strong&gt;&lt;/em&gt;as first line of our stored procedure. It will help Entity Framework to find our the list of column Stored Procedure returns.&lt;br /&gt;
&lt;strong&gt;Step 2:&amp;nbsp;&lt;/strong&gt;Move to your .edmx and At Model Browser Window/Function Imports find your procedure then double click it. A window will open as shown below&lt;br /&gt;
&lt;img alt=&quot;&quot; class=&quot;size-medium wp-image-248 aligncenter&quot; height=&quot;169&quot; src=&quot;http://www.sandeepknarware.in/wp-content/uploads/2017/12/ed_stored_proc-300x169.png&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;
&lt;strong&gt;Step 3: &lt;/strong&gt;Change the return type to complex type and then click on generate complete type button. It will generate a class which will represent the return type of stored procedure.&lt;br /&gt;
Now we will be able to use the stored produce and it will return a a list of POCO class which was generated in step 3.&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetdeewane.blogspot.com/feeds/5131911139433877101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/stored-procedure-returns-int-instead-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/5131911139433877101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4406100039163587256/posts/default/5131911139433877101'/><link rel='alternate' type='text/html' href='http://dotnetdeewane.blogspot.com/2018/07/stored-procedure-returns-int-instead-of.html' title='Stored procedure returns int instead of result set'/><author><name>Sandeep Kumar Narware</name><uri>http://www.blogger.com/profile/07447686829891643060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREPwFWfokb0xQbJpUOe04cFbITIS7P1RHZpBUizxH8BJynEeaEnsrMY4OVIIxEDBDRITaynyuGW5i8iG_VzUVB_o_WR_0s-kImsIOl8IQFqiUCKs2lK7uBC6lR0_Clg/s220/PassportSizePhoto%5B1%5D.jpg'/></author><thr:total>0</thr:total></entry></feed>