<?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-8299118965403138061</id><updated>2024-08-30T11:34:54.259+05:30</updated><title type='text'>Bibhas&#39;s Blog</title><subtitle type='html'>Sharing is caring</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-7742133511789606017</id><published>2021-05-16T17:18:00.006+05:30</published><updated>2021-05-16T17:29:13.086+05:30</updated><title type='text'>File recovery from VM backup(Recovery Service vault)</title><content type='html'>&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Backup service can be enabled on VM through recovery service vault. This will primarily facilitate restoration of a VM from Backup when disaster happens.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Full VM restoration is&amp;nbsp; rare requirement&amp;nbsp;,how about recovering&amp;nbsp; files/folders incase the same is corrupted or accidentally deleted.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;File recovery capability of Recovery&amp;nbsp;service vault can take care of this requirement.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;1. Go to respective Vault&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;2. Select &quot;Backup Items&quot; from left panel&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;3. Select the desire item from right side window.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;4. From top menu click on &quot;File Recovery&quot; and follow the steps below&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;&lt;br /&gt;&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/b/R29vZ2xl/AVvXsEgEb1kdgkMojebfISR0DRjZT7v9Osk-gikqR48XjPrNRdYeaN9vmhFteQUe5hqwF0jBRV0q4qnmuJh6XUKAsFzc8ytBZNyfbNOjQh_PxwBSYlSbpOtZlC3be_wjLy4FsQoPy9kvw7tnwyOr/s728/FileRecovery.png&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;728&quot; data-original-width=&quot;339&quot; height=&quot;721&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEb1kdgkMojebfISR0DRjZT7v9Osk-gikqR48XjPrNRdYeaN9vmhFteQUe5hqwF0jBRV0q4qnmuJh6XUKAsFzc8ytBZNyfbNOjQh_PxwBSYlSbpOtZlC3be_wjLy4FsQoPy9kvw7tnwyOr/w336-h721/FileRecovery.png&quot; width=&quot;336&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: large;&quot;&gt;5. Click on the dropdown &quot;Step 1: Select recovery point&quot; and search for desire target date&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;6.&amp;nbsp; Save &quot;Download Executable&quot; locally and&amp;nbsp; run it, This will create a MAP drive&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;7.&amp;nbsp; Open windows explorer and browse through the map drive and copy the desire&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;files/folder to target VM&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Once done , don&#39;t forgot to click &quot;Unmount Disk&quot;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/7742133511789606017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/file-recovery-from-vm-backuprecovery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/7742133511789606017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/7742133511789606017'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/file-recovery-from-vm-backuprecovery.html' title='File recovery from VM backup(Recovery Service vault)'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEb1kdgkMojebfISR0DRjZT7v9Osk-gikqR48XjPrNRdYeaN9vmhFteQUe5hqwF0jBRV0q4qnmuJh6XUKAsFzc8ytBZNyfbNOjQh_PxwBSYlSbpOtZlC3be_wjLy4FsQoPy9kvw7tnwyOr/s72-w336-h721-c/FileRecovery.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-774087046879484510</id><published>2021-05-15T09:50:00.003+05:30</published><updated>2021-05-15T19:56:07.788+05:30</updated><title type='text'>Remove a specific recovery point from Recovery service vault</title><content type='html'>&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;No you can&#39;t do that. &lt;br /&gt;This is not allowed either from Azure portal or from PowerShell and CLI.&lt;br /&gt;I had a business requirement to move 8 years VM backup from Recovery Vault to Blob Storage.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;It was completely&amp;nbsp;a manual activity as Azure doesn&#39;t offer data migration from vault to storage.&amp;nbsp; We decided to remove restore&amp;nbsp;point from vault as soon as we move the data to storage to reduce vault cost.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;This approach didn&#39;t stand since recovery service vault&amp;nbsp;doesn&#39;t support deletion of restoration&amp;nbsp;point. As an alternative we decided to modify BackUpPolicy and reduce retention period progressively in sync with data migration progress. Team who worked they started moving vault&amp;nbsp;data from most old restoration pint to most recent point.&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/774087046879484510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/remove-specific-recovery-point-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/774087046879484510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/774087046879484510'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/remove-specific-recovery-point-from.html' title='Remove a specific recovery point from Recovery service vault'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-6194218571295153204</id><published>2021-05-15T09:11:00.003+05:30</published><updated>2021-05-15T09:16:31.076+05:30</updated><title type='text'> Azure VM - static private IP address</title><content type='html'>&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: large;&quot;&gt;When&amp;nbsp; we create a Azure VM, it automatically assign a private IP address from the range define in subnet where VM is deployed.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;This private IP will remain unchanged until VM is deallocated or decommissioned.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;If Network configuration demands a fixed private IP assign to the VM which should work even after VM resumes from deallocation, then static private IP address would be the solution.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Static private&amp;nbsp;IP address allows a specific hand&amp;nbsp;picked IP address assign to the VM.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Static IP address is specially needed&amp;nbsp; when private DNS requires a A record entry.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Assign static IP address is easy:-&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;1. Select the VM from Azure portal&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;2. Go to &quot;Networking&quot; page and select &quot;Network Interface&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;3. Click on existing IP address from list&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;4. Now change the assignment to &quot;Static&quot; from &quot;Dynamic&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;5. In the text below specify the desire IP address and click on save.&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/6194218571295153204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/azure-vm-static-private-ip-address-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/6194218571295153204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/6194218571295153204'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/azure-vm-static-private-ip-address-when.html' title=' Azure VM - static private IP address'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-2833344259116818976</id><published>2021-05-13T23:55:00.004+05:30</published><updated>2021-05-15T09:16:01.035+05:30</updated><title type='text'>Vault cannot be deleted as there are existing resources within the vault</title><content type='html'>&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;I spent almost half of a day to figure out this issue.&amp;nbsp; Exception was self explanatory but finding the solution&amp;nbsp;was difficult.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;You may experience this error when try to remove a Recovery service vault, Root cause is explained below.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;This error signifies that Recovery vault has dependency on a storage account. To resolve this issue, you have to unregister storage&lt;/span&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;&amp;nbsp;account from vault.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Steps are very easy :-&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;1. Go to target recovery service vault&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;2. Select &quot;Backup Infrastructure&quot; from left side panel&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;3. Select &quot;Storage Accounts&quot; from left side panel&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;4. From the right side panel , select the storage name and then click on &quot;Unregister&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Now try to delete the vault again and see the magic.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/2833344259116818976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/vault-cannot-be-deleted-as-there-are.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/2833344259116818976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/2833344259116818976'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/vault-cannot-be-deleted-as-there-are.html' title='Vault cannot be deleted as there are existing resources within the vault'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-5551940666692417205</id><published>2021-05-12T20:41:00.002+05:30</published><updated>2021-05-15T09:16:49.022+05:30</updated><title type='text'> Advantage of  MFT over normal FTP</title><content type='html'>&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: large;&quot;&gt;MFT&amp;nbsp; stand for Managed File Transfer and FTP stands for File Transfer Protocol.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Both are use for transferring file from client computer to server computer.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;However considering&amp;nbsp;cybersecurity threats in mind&amp;nbsp; it is always advisable&amp;nbsp;to use MFT.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Traditional FTP service transfer file over unsecure channel&amp;nbsp; whereas MFT support advanced security protocol and transfer file over a secure channel. It supports variety&amp;nbsp;of protocols like.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;1. FTPS&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: large;&quot;&gt;2. SFTP&lt;br /&gt;3. AS2&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/5551940666692417205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/advantage-of-mft-over-normal-ftp-mft.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/5551940666692417205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/5551940666692417205'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/advantage-of-mft-over-normal-ftp-mft.html' title=' Advantage of  MFT over normal FTP'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-8468845418819605193</id><published>2021-05-12T00:16:00.007+05:30</published><updated>2021-05-15T09:17:05.394+05:30</updated><title type='text'>Update VM size for old generation VM</title><content type='html'>&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: large;&quot;&gt;Your workload&amp;nbsp;is hosted on old generation or promo SKU, for such situation migrating to a new generation SKU is always difficult. We can&#39;t find the desire SKU from VM upgradation bled.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;&lt;u&gt;Following are the steps to accomplish this.&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;1. Deallocate the VM (Not stop , deallocate is different than stop)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;2. Go to VM upgradation bled and select desire VM size and proceed.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #2b00fe; font-family: Calibri; font-size: medium;&quot;&gt;Note: Desire VM size will not available until&amp;nbsp;VM is deallocated.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Cons: Deallocation of VM will release dynamic IP(public and private), make sure your infrastructure doesn&#39;t depend on existing dynamic IP otherwise assign static IP to VM before resizing.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Take a full backup of VM for disaster , there might be a chance of unsuccessful upgradation.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/8468845418819605193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/vm-size-for-old-generation-vm-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/8468845418819605193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/8468845418819605193'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/vm-size-for-old-generation-vm-your.html' title='Update VM size for old generation VM'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-4886736539425140498</id><published>2021-05-10T23:35:00.005+05:30</published><updated>2021-05-15T09:17:19.887+05:30</updated><title type='text'> Azure Constrained vCPU</title><content type='html'>&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: large;&quot;&gt;Azure VM vCPU and RAM always proportionally increase from one SKU to immediate next SKU.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;This method doesn&#39;t stand for vCPU based software license like database software e.g. SQL Server and Oracle.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Database software often demands more memory to add whereas vCPU will remain unchanged.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Calibri; font-size: medium;&quot;&gt;Azure constrained vCPU will address this issue. This will allow to add/remove more RAM on the same workload&amp;nbsp; whereas vCPU and other parameter will be same.&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/4886736539425140498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/constrained-vcpu-azure-vm-vcpu-and-ram.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/4886736539425140498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/4886736539425140498'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2021/05/constrained-vcpu-azure-vm-vcpu-and-ram.html' title=' Azure Constrained vCPU'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-7440339869099346075</id><published>2012-12-03T16:40:00.000+05:30</published><updated>2020-03-04T19:15:51.431+05:30</updated><title type='text'>DbSet.Find() in Entity Framework</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;DbSet.Find method in Entity framework provides some cool and awesome features.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;Unlike other it doesn’t except lambda expression whereas it accept only primary key(s) value.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; cat = dbContext.Categories.Find(1);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;Above will retrieve the category where category id is 1. “categoryid” is defined as primary key in the underlying table. Incase composite primary key we should pass values in the same sequence of keys.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; data = dbContext.Products.Find(1, 10);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;So far, behavior is simple but nothing special. Wait ….following features will make it incredible.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;Find() will always not make a database trip to fetch the data rather it supports following principles.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;margin-bottom: 0pt; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.&lt;span style=&quot;font: 7pt &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;Find the data in memory and returns it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;br /&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; cat = dbContext.Categories.Find(1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;cat.Description = &lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;Modified&quot;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background: white; color: green; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;//Modified data in the memory will be returned&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;cat = dbContext.Categories.Find(1);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0pt; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.&lt;span style=&quot;font: 7pt &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;Look at the newly added data in memory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; cats = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;Category&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin: 0in 0in 0pt 1in; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;{ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin: 0in 0in 0pt 1.5in;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp; CategoryID = 1001, CategoryName = &lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;New Category&quot;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin: 0in 0in 0pt 1in; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&amp;nbsp; Description = &lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&quot;New Category Description&quot;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin: 0in 0in 0pt 1in; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;dbContext.Categories.Add(cats);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background: white; color: green; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;// newly added data in the memory will be returned&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;cats = dbContext.Categories.Find(1001);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-bottom: 0pt; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;3&amp;nbsp;&amp;nbsp; 3.&lt;span style=&quot;font: 7pt &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;It makes a database trip only when 1&amp;nbsp;and 2 fails to return any data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 10pt;&quot;&gt;Wonderful isn’t it. I really liked it very much.&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/7440339869099346075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2012/12/dbsetfind-in-entity-framework.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/7440339869099346075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/7440339869099346075'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2012/12/dbsetfind-in-entity-framework.html' title='DbSet.Find() in Entity Framework'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-7126322034878801425</id><published>2012-11-29T12:49:00.000+05:30</published><updated>2012-11-29T18:00:35.374+05:30</updated><title type='text'>LINQ and equivalent LAMDA expression</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;This discussion I will try to provide some common LINQ statement
and the equivalent LAMDA expression. This is purely personal preference to
choose LINQ or Lamda. I am not going to describe which one is the best way
considering performance as parameter. What I noticed both emit the same IL code
after compilation. I used Entity framework 5.0 and Northwind database for this
sample.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 12pt;&quot;&gt;Retrieve all records&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LINQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Categories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LAMDA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;dbContext.Categories.Select(c
=&amp;gt; c);&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 12pt;&quot;&gt;Specific fields&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LINQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Categories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; { c.CategoryName,
c.CategoryID };&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LAMDA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;dbContext.Categories.Select(c
=&amp;gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; {
c.CategoryName, c.CategoryID })&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 12pt;&quot;&gt;Orderby asc&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LINQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Categories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;orderby&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c.CategoryName&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LAMDA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;dbContext.Categories.OrderBy(c
=&amp;gt; c.CategoryName);&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 12pt;&quot;&gt;Orderby dsc&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LINQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Categories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;orderby&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c.CategoryName &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;descending&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LAMDA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
dbContext.Categories.OrderByDescending(c =&amp;gt; c.CategoryName)&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 12pt;&quot;&gt;Multiple orderby&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LINQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Categories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;orderby&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c.CategoryName , c.CategoryID&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LAMDA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
dbContext.Categories.OrderBy(c =&amp;gt; c.CategoryName).ThenBy(c =&amp;gt; c.CategoryID);&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 12pt;&quot;&gt;Orderby asc and dec&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LINQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Categories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;orderby&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c.CategoryName, c.CategoryID &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;descending&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LAMDA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;dbContext.Categories.OrderBy(c =&amp;gt; c.CategoryName)&lt;br /&gt;
.ThenByDescending(c =&amp;gt; c.CategoryID);&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 12pt;&quot;&gt;Filter&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LINQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Categories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c.CategoryID.Equals(1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LAMDA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;dbContext.Categories.Where(c
=&amp;gt; c.CategoryID.Equals(1));&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 12pt;&quot;&gt;Filter with multiple
criteria&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LINQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Categories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c.CategoryID.Equals(1) &amp;amp;&amp;amp; c.CategoryName.StartsWith(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;A&quot;&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LAMDA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;dbContext.Categories.Where(c
=&amp;gt; c.CategoryID.Equals(1) &amp;amp;&amp;amp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c.CategoryName.StartsWith(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;A&quot;&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;));&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 12pt;&quot;&gt;Group By&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LINQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Categories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;group&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;by&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c.CategoryName &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;into&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; g&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; g;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LAMDA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;dbContext.Categories.GroupBy(c
=&amp;gt; c.CategoryName)&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 12pt;&quot;&gt;Multiple group By&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LINQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Categories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;group&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;by&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; { c.CategoryID, c.CategoryName } &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;into&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; g&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; g;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LAMDA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;dbContext.Categories.GroupBy(c
=&amp;gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; {
c.CategoryID, c.CategoryName })&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 12pt;&quot;&gt;Record Count&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LINQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Categories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c.CategoryName.StartsWith(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;B&quot;&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;
c).Count();&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LAMDA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;dbContext.Categories.Count(c
=&amp;gt; c.CategoryName.StartsWith(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;B&quot;&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;));&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 12pt;&quot;&gt;Join&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LINQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Categories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;join&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; p &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dbContext.Products1 &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; c.CategoryID &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;equals&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; p.CategoryID&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;CategoryName,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p.ProductID,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p.ProductName&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;LAMDA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;dbContext.Categories.Join(dbContext.Products1, c =&amp;gt; c.CategoryID, P
=&amp;gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; P.CategoryID,((c,p)=&amp;gt;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; {c.CategoryName,p.ProductID,p.ProductName}));&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/7126322034878801425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2012/11/linq-and-corresponding-lamda-expression.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/7126322034878801425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/7126322034878801425'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2012/11/linq-and-corresponding-lamda-expression.html' title='LINQ and equivalent LAMDA expression'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-1397006607614265112</id><published>2012-11-28T15:30:00.000+05:30</published><updated>2012-11-29T22:14:32.460+05:30</updated><title type='text'>Entity framework and data iteration</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;We can write following piece of code to retrieve all records using DBSet. If we look at the database&amp;nbsp;pro-filer&amp;nbsp;we could see “&lt;/span&gt;&lt;span style=&quot;color: #0070c0; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;SELECT * FROM Category&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;” statement issued in the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: Consolas; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt; dbContext = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: Consolas; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: Consolas; mso-highlight: white;&quot;&gt;NorthwindEntities&lt;/span&gt;&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;Category&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;cat&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;dbContext.Categories)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;.WriteLine(cat.CategoryName);&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Some time we may need to iterate the same set of result set multiple times in a logical unit like below.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;private void LogicalUnit()&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: Consolas; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt; dbContext = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: Consolas; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: Consolas; mso-highlight: white;&quot;&gt;NorthwindEntities&lt;/span&gt;&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;Category&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;cat&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;dbContext.Categories)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt 0.5in;&quot;&gt;
&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;.WriteLine(cat.CategoryName);&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt 0.5in;&quot;&gt;
&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;Category&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;cat&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;dbContext.Categories)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt 0.5in;&quot;&gt;
&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;.WriteLine(cat.CategoryName);&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt 0.5in;&quot;&gt;
&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Apparently everything looks fine but I wondered when I looked into the&amp;nbsp;pro-filer&amp;nbsp;and saw above SQL statement issued twice.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;To avoid this, we can perform LINQ operation such as ToList() to copy the result set into a list and iterate the list whenever required.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;categories = dbContext.Categories.ToList();&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;Category&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;cat&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;categories)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;.WriteLine(cat.CategoryName);&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;Category&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;cat&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background: white;&quot;&gt;categories)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;background: white; color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-fareast-font-family: &#39;Times New Roman&#39;;&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;.WriteLine(cat.CategoryName);&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;background-clip: initial; background-color: white; background-origin: initial; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 115%;&quot;&gt;This will hit the database only once to execute the query. We can refer the local result set for further reference. This way we can bring down the repeated database hit.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/1397006607614265112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2012/11/entity-framework-and-data-iteration.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/1397006607614265112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/1397006607614265112'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2012/11/entity-framework-and-data-iteration.html' title='Entity framework and data iteration'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-2588746890037042738</id><published>2010-02-22T22:41:00.000+05:30</published><updated>2010-02-23T23:03:08.912+05:30</updated><title type='text'>Reduce ASP.NET Page Size</title><content type='html'>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This article I have posted in dotnetfunda.com on 22-Feb-2010. It says about how to reduce ASP.NET page size. Refer below the link for further details.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://www.dotnetfunda.com/articles/article793-reduce-aspnet-page-output-size-.aspx&quot;&gt;Reduce ASP.NET page size&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;The same tip and trick&amp;nbsp;also published in &lt;a href=&quot;http://www.codeproject.com/tips/60760/Reduce-ASP-NET-Page-Output-Size.aspx&quot;&gt;Code Project&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/2588746890037042738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2010/02/reduce-aspnet-page-size.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/2588746890037042738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/2588746890037042738'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2010/02/reduce-aspnet-page-size.html' title='Reduce ASP.NET Page Size'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-306146195588608710</id><published>2010-02-14T15:42:00.000+05:30</published><updated>2010-02-14T15:49:21.246+05:30</updated><title type='text'>ADO.NET DataTable as XML parameter to an Oracle/SQL Server Database Stored Procedure</title><content type='html'>I have posted this article in codeproject.com on 27th-Jan-2010. This article is all about how to convert ado.net datatable to XML and pass it  as a parameter to backend. To get the detail please refer belo the link&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/KB/database/DataTableAsXMLToDataBase.aspx&quot;&gt;ADO.NET DataTable as XML parameter to an Oracle/SQL Server Database Stored Procedure&lt;br /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/306146195588608710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2010/02/adonet-datatable-as-xml-parameter-to.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/306146195588608710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/306146195588608710'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2010/02/adonet-datatable-as-xml-parameter-to.html' title='ADO.NET DataTable as XML parameter to an Oracle/SQL Server Database Stored Procedure'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8299118965403138061.post-7899994241429281429</id><published>2010-02-14T15:33:00.000+05:30</published><updated>2010-02-14T15:38:55.700+05:30</updated><title type='text'>Business Entity as XML</title><content type='html'>This article I have posted in dotnetfunda.com on 13th-Feb-2010. This is all about how to convert a business entity to XML. Refer below the link for details discussion.&lt;br /&gt;&lt;a href=&quot;http://www.dotnetfunda.com/articles/article787-various-options-to-convert-business-entity-class-as-xml-.aspx&quot;&gt;Convert Business Entity or Entity collection as XML&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bibhaspaul.blogspot.com/feeds/7899994241429281429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bibhaspaul.blogspot.com/2010/02/business-entity-as-xml.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/7899994241429281429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8299118965403138061/posts/default/7899994241429281429'/><link rel='alternate' type='text/html' href='http://bibhaspaul.blogspot.com/2010/02/business-entity-as-xml.html' title='Business Entity as XML'/><author><name>Bibhas Paul</name><uri>http://www.blogger.com/profile/17336704128482344240</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGHRRhwV4pKQRnZNNqtwSzAl0tTJR0Let8YBxrgB0VRCvOoWXW3ZC8H_fHwyB_8WFGRj7iTLc4Yer_Tg62g8UKDp3Bg6cSJLDZL6hEpV_Y8_5pRh1Wrr4B5UmWH4I0ek/s113/Image.jfif'/></author><thr:total>3</thr:total></entry></feed>