<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag '.NET General'</title><link>http://weblogs.asp.net/search/SearchResults.aspx?q=&amp;tag=.NET+General&amp;orTags=0&amp;o=DateDescending</link><description>Search results matching tag '.NET General'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>E-Mail Storm flooding Hewlett-Packard</title><link>http://weblogs.asp.net/israelio/archive/2010/01/04/e-mail-storm-flooding-around-at-hewlett-packard.aspx</link><pubDate>Mon, 04 Jan 2010 05:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7299841</guid><dc:creator>israelio</dc:creator><author>israelio</author><description>&lt;P&gt;What is an E-mail storm ?&lt;/P&gt;
&lt;P&gt;From &lt;A href="http://en.wikipedia.org/wiki/E-mail_storm" mce_href="http://en.wikipedia.org/wiki/E-mail_storm"&gt;Wikipedia&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;An e-mail storm is a sudden spike of Reply All messages on an email distribution list, usually caused by a controversial or misdirected message. Such storms start when multiple members of the distribution list reply to the entire list at the same time in response instigating message. Other members soon respond, usually adding vitriol to the discussion, asking to be removed from the list, or pleading for the cessation of messages. If enough members reply to these unwanted messages this triggers a chain reaction of email messages. The sheer load of traffic generated by these storms can render the email servers inoperative, similar to a DDoS attack.&lt;/P&gt;
&lt;P&gt;On the 31/12/2009 10:20 the following email was send by someone in HP, his/her mistake was that it was sent to the wrong address, the email was sent to an exchange discussion list which hold all the employees who has remote access to the company – yes all the employees who has remote access to HP and you can start counting them…&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/israelio/image_24510FB4.png" mce_href="http://weblogs.asp.net/blogs/israelio/image_24510FB4.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://weblogs.asp.net/blogs/israelio/image_thumb_0F4F6774.png" width=573 height=390 mce_src="http://weblogs.asp.net/blogs/israelio/image_thumb_0F4F6774.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In response to this email hundreds if not more emails were sent back using Replay-To-All asking to be removed from the DL as people were/are flooded with emails – anyone who responded responded back to the DL itself and by that sending email again to company wide.&lt;/P&gt;
&lt;P&gt;One email was hilarious, someone decided to send to the DL an email asking ppl to take an outlook training over the internal portal hoping that ppl will learn NOT to press Replay-To-All&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/israelio/image_37BE23BB.png" mce_href="http://weblogs.asp.net/blogs/israelio/image_37BE23BB.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://weblogs.asp.net/blogs/israelio/image_thumb_4DC48F4D.png" width=578 height=255 mce_src="http://weblogs.asp.net/blogs/israelio/image_thumb_4DC48F4D.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This led to a line of even more hilarious emails as some employees answered to the DL that they are not using outlook and they are using linux systems and as such what will be with their bonus, do they need to take the training or not ? :-)&lt;/P&gt;
&lt;P&gt;I’ve noticed several emails requesting ppl to stop sending emails but the flood is keep on coming… &lt;/P&gt;
&lt;P&gt;If you look at Wikipedia again for former incidents:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;On October 14, 1997, a Microsoft employee noticed that they were on an as-yet unknown email distribution list 'Bedlam DL3', and emailed the list asking to be removed. This list contained approximately a quarter of the company's employees, 13,000 email addresses. Other users replied to the list with similar requests and still others responded with pleas to stop replying to the list. A Microsoft employee estimates that 15 million emails were sent, using 195 GB of bandwidth.&lt;/LI&gt;
&lt;LI&gt;On October 3, 2007, an email storm was generated at the US Department of Homeland Security, causing more than 2.2 million messages to be sent, and exposing the names of hundreds of security professionals.&lt;/LI&gt;
&lt;LI&gt;State Department employees were warned they could face disciplinary action for taking part in a massive email storm that "nearly knocked out one of the State Department's main electronic communications systems." &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;It really makes you think of what can a simple mistake of an employee can cause to a company…&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;B&gt;Beware of whom you send you email to, choose you DL wisely and please please please think for a min before hitting the Replay-To-All.&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#008000&gt;Note: A much better was it to replay to all while putting the DL in the bcc field… this way if someone do use Replay-To-All he needs to specifically enter the DL name again&lt;/FONT&gt;&lt;/P&gt;</description></item><item><title>This is why algorithms rule</title><link>http://weblogs.asp.net/fbouma/archive/2009/12/11/this-is-why-algorithms-rule.aspx</link><pubDate>Fri, 11 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7276585</guid><dc:creator>FransBouma</dc:creator><author>FransBouma</author><description>&lt;p&gt;For the people who know me a little it's no surprise, but in case you didn't know: I love algorithms. I think they're the cornerstone of good software and they should be your first source of wisdom for &lt;em&gt;every&lt;/em&gt; piece of software you're creating. This post will show an example of what I mean by that and how easy it is if you have a set of algorithms at your disposal which are solid, proven and correct. &lt;/p&gt;  &lt;p&gt;The nice thing about algorithms is that you can reason over them without writing a single line of code. Another nice thing about algorithms is that many smart people out there have already documented and proven even more algorithms. This is important, because a proven algorithm has a key feature: it's correct within the boundaries stated by the algorithm itself (e.g. 'correct for all positive numbers'). A correct algorithm is great for writing software because you don't have to worry if the algorithm is buggy, it's not. All you have to do is implement it correctly. That can be done by taking baby-steps in projecting the algorithm to code, reviewing the code and if you don't trust your own skills, writing tests for the boundaries stated for the algorithm. Compare that to code where the algorithm also has to be tested and you'll quickly understand how important good solid algorithms are: they allow you to make you write software which is flawless without a lot of effort. &lt;/p&gt;  &lt;p&gt;With &lt;a href="http://www.llblgen.com" target="_blank"&gt;LLBLGen Pro&lt;/a&gt; v3.0, which will hit its first beta in January 2010 (fingers crossed! &lt;img src="http://www.xs4all.nl/~perseus/smileys/smileywink.gif" /&gt; ), we'll also ship the source-code of our algorithm library Algorithmia (and every v3 licensee is allowed to re-use that code in whatever form they see fit, within the boundaries of the flexible license of course). Algorithmia contains algorithms for graphs, queues, heaps, commands etc. etc. and offers a ready-to-rock set of classes and methods to build software with without worrying if the algorithm is even working in all cases. Algorithmia is written with .NET 3.5 and contains only classes which are not already found in .NET 3.5's BCL. This means that we only implemented functionality not found in .NET itself. For example, there's a KeyedCommandifiedList&amp;lt;T&amp;gt;. This List&amp;lt;T&amp;gt; lookalike class is &lt;em&gt;command aware&lt;/em&gt; which means it's fully aware of undo/redo: every element addition/removal action can be undone and re-done. It's also &lt;em&gt;keyed&lt;/em&gt; and can update it's own index based on changes of itself or the elements within itself without any help from the outside. Still it's a list and an enumerable. Its FindByKey() method is roughly an O(1) operation (amortized), no matter how big the set of elements in the list is.&lt;/p&gt;  &lt;p&gt;Another example is the set of graph classes (directed and non-directed) and accompanying classes and algorithms. Not only are the graph classes usable in a commandified environment (and can be made undo/redo aware in full), they also can be used with SubGraphView classes, which are views on a graph and which contain a sub-set of the elements (vertices) and edges of the graph they're defined on. These views manage themselves, so if an element is removed from the graph, they detect that and also remove the element from themselves. You can subclass the views and override methods to intercept additions to the main graph to maintain views automatically as well. You can see this in action in a &lt;a href="http://weblogs.asp.net/fbouma/archive/2009/11/25/llblgen-pro-v3-0-model-first-with-quickmodel-and-more.aspx" target="_blank"&gt;video I recently posted about LLBLGen Pro v3.0's QuickModel feature&lt;/a&gt;: the view you're looking at on the main graph updates itself when a new element is added to the main graph and it matches a set of rules.&lt;/p&gt;  &lt;p&gt;But enough about that, let's look at another practical example of these classes in action: let's look at validation and examining data in data-structures with algorithms. The case in point is to see if fields in an entity B which is a split-off entity of entity A and which aren't mapped in A are optional (nullable). If they're not, we've to reflect that to the user with an error. LLBLGen Pro v3.0 has a deep validation system to make sure the model is valid before further action is taken (e.g. code is generated, it's updated from refreshes etc.). This validation system is of course extensible so you can add your own validation as well and has per-target framework validation so it validates in the scope of the target framework chosen (e.g. LLBLGen Pro runtime framework, Linq to sql etc.)&lt;/p&gt;  &lt;p&gt;What exactly is a split-off entity? Say you have the Employees table in Northwind. This Employees table has two big fields: Photo, which is an Image (BLOB for oracle fans) typed field and Notes which is an NText (CLOB for oracle fans) typed field. &lt;a href="http://www.llblgen.com" target="_blank"&gt;LLBLGen Pro&lt;/a&gt; today, in v2.6, has the feature to exclude them from a fetch and load them at a later point. However, v3.0 will also support other frameworks and for example in the Entity Framework, it's solved in a different way: it supports multiple entities mapped onto the same table with a 1:1 PK-PK relationship between them. This means in practice that the entities which are 'split off' have to be &lt;em&gt;merged&lt;/em&gt; into the same record in the table as the root of the entities when they're persisted to the database.&lt;/p&gt;  &lt;p&gt;In the example of Employees, let's map two entities onto this table, EmployeeNoBlob and EmployeeBlob. EmployeeNoBlob has fields mapped to all Employees fields except Photo and Notes, and EmployeeBlob has besides the primary key EmployeeId only the fields Photo and Notes. EmployeeNoBlob is the 'root' of the two: if a new entity instance of that type is saved, it's &lt;em&gt;inserted&lt;/em&gt; into the table Employees. However if an instance of EmployeeBlob is saved it's always resulting in an &lt;em&gt;UPDATE&lt;/em&gt; statement. This because it's actually an entity which follows the root and this is the result of its primary key field which is depending on the primary key field of EmployeeNoBlob.&lt;/p&gt;  &lt;p&gt;To validate the fields of EmployeeNoBlob and EmployeeBlob, we first have to find all entities which form a split group, thus which are all mapped onto the same target and one of them is the root and the rest is split off this root. We have to make sure we don't take into account entities which are also mapped onto this target but which aren't part of the group, otherwise we'll get false positives. &lt;/p&gt;  &lt;p&gt;So how do you find these groups and how do you make sure you know what the root of such a group is?&lt;/p&gt;  &lt;p&gt;All entities and their relationships are stored in a non-directed graph in the project: the EntityModel graph. So we first have to find all 1:1 relationships which are between two primary keys. Then we have to make sure both sides are mapped onto the same target. &lt;/p&gt;  &lt;p&gt;Once we have that set of relatonships, we can create a new graph from those relationships (which are the &lt;em&gt;edges&lt;/em&gt; in the graph) and tell a fancy algorithm in Algorithmia, the DisconnectedGraphFinder, to find all sub-graphs in this new graph which are disconnected from each-other. Each sub-graph is then returned as a SubGraphView and we can process each view further as each view is a split-group.&lt;/p&gt;  &lt;p&gt;To find the root of a split-group, we can use another algorithm, the TopologicalSorter. We create from every relationship in a SubGraphView a directed edge in a directed graph, and sort that graph topological. &lt;a href="http://en.wikipedia.org/wiki/Topological_sorting" target="_blank"&gt;Topological sorting&lt;/a&gt; is a well-known algorithm which tells you in what order a directed graph is ordered. In other words: it finds dependencies and orders the elements accordingly. &lt;/p&gt;  &lt;p&gt;Once we have the root per group, we're practically done because we can then verify which fields are not mapped in the entities in a group which aren't the root and verify whether they're optional or not. &lt;/p&gt;  &lt;p&gt;So how does this look in code? Let's look at the method which produces the list of split-off entities first. This method isn't inside the EntityModel as entity splitting depends on the mapped target and therefore it's located in the DatabaseMappingStore class.&lt;/p&gt;  &lt;pre class="c#" name="code"&gt;/// &amp;lt;summary&amp;gt;
/// Gets all split entities, per target. A split entity is really a group of entities which are mapped onto 
/// the same target and which all have 1:1 pk-pk relationships with one entity in their group. If A, B, C and D are 
/// mapped onto the same target T and B and D have a 1:1 pk-pk relationship towards A (pkside), and C does not, 
/// it means that B and D are 'split off' of A. C is not part of the split and is ignored. Returned is then A with 
/// its split off companions B and D. A is then returned as key with values B and D.&amp;lt;/summary&amp;gt;
/// &amp;lt;param name=&amp;quot;containingProject&amp;quot;&amp;gt;The containing project.&amp;lt;/param&amp;gt;
/// &amp;lt;returns&amp;gt;Multivalue dictionary with as key the root of the group and as values all split off entities.&amp;lt;/returns&amp;gt;
/// &amp;lt;remarks&amp;gt;Split-off entities are used for validations. Not all frameworks support split-off entities.&amp;lt;/remarks&amp;gt;
public MultiValueDictionary&amp;lt;EntityDefinition, EntityDefinition&amp;gt; GetAllSplitEntities(Project containingProject)
{
    var allOneToOnePkPkRelationships = containingProject.EntityModel.Edges
                                     .Where(e =&amp;gt; e.RelationshipType == EntityRelationshipType.OneToOne)
                                     .Cast&amp;lt;NormalRelationshipEdge&amp;gt;().Where(e =&amp;gt; e.FkFieldsFormPkOfFkSide);

    var allOneToOnePkPkRelationshipsWithBothSideOnSameTarget = allOneToOnePkPkRelationships
                            .Where(e=&amp;gt;_entityMappings.FindFirstByKey(e.EntityPkSide).MappedTarget==
                                      _entityMappings.FindFirstByKey(e.EntityFkSide).MappedTarget).ToHashSet();

    // now add all found edges in a graph and determine all disconnected subgraphs. These are our groups. We do that 
	// by traversing the graph we create with a disconnected graphs finder, which is a DFS based algorithm for graphs.
    var groupFinderSourceGraph = new NonDirectedGraph&amp;lt;EntityDefinition, NonDirectedEdge&amp;lt;EntityDefinition&amp;gt;&amp;gt;();
    foreach(var foundRelationship in allOneToOnePkPkRelationshipsWithBothSideOnSameTarget)
    {
        groupFinderSourceGraph.Add(new NonDirectedEdge&amp;lt;EntityDefinition&amp;gt;(
		                               foundRelationship.EntityFkSide, foundRelationship.EntityPkSide));
    }
    var groupFinder = new DisconnectedGraphsFinder&amp;lt;EntityDefinition, NonDirectedEdge&amp;lt;EntityDefinition&amp;gt;&amp;gt;(
                                () =&amp;gt; new SubGraphView&amp;lt;EntityDefinition, 
								               NonDirectedEdge&amp;lt;EntityDefinition&amp;gt;&amp;gt;(groupFinderSourceGraph), 
                                groupFinderSourceGraph);
    groupFinder.FindDisconnectedGraphs();

    var toReturn = new MultiValueDictionary&amp;lt;EntityDefinition, EntityDefinition&amp;gt;();
    foreach(var subgraphView in groupFinder.FoundDisconnectedGraphs)
    {
        // create a new directed graph which is topological sorted, based on the edges in the subgraphview. The 
		// ordering will give us the root and the rest. fk side is start vertex, pk side is end vertex in the non-directed 
		// edges in the view (which is a view on groupFinderSourceGraph).
        var sortedSourceGraph = new DirectedGraph&amp;lt;EntityDefinition, DirectedEdge&amp;lt;EntityDefinition&amp;gt;&amp;gt;();
        foreach(var edge in subgraphView.Edges)
        {
            sortedSourceGraph.Add(new DirectedEdge&amp;lt;EntityDefinition&amp;gt;(edge.StartVertex, edge.EndVertex));
        }
        var sorter = new TopologicalSorter&amp;lt;EntityDefinition, DirectedEdge&amp;lt;EntityDefinition&amp;gt;&amp;gt;(sortedSourceGraph);
        sorter.Sort();
        // views are always filled with at least 1 edge, which means at least 2 entity definitions, as edges are 
		// relationships between pk's, so sides are always different. The first entity is the root, the rest is the 
		// set of split off entities.
        toReturn.Add(sorter.SortResults[0], sorter.SortResults.Skip(1).ToHashSet());
    }
    return toReturn;
}&lt;/pre&gt;

&lt;p&gt;You might see some extension methods or classes you don't know, like the MultiValueDictionary, they're all in Algorithmia. Looks pretty straightforward and actually pretty easy, simply because it's based on building blocks which are already working and solid. I don't have to worry if the Topological sorter really finds the right order, it does, because the algorithm is correct and the implementation works.&lt;/p&gt;

&lt;p&gt;Once we have these entities, we can simply traverse them and match the fields:&lt;/p&gt;

&lt;pre class="c#" name="code"&gt;var allSplitEntities = GetAllSplitEntities(containingProject);

// now validate the entities per group (root(key) + rest (values)). All entities in allSplitEntities have mappings
foreach(var kvp in allSplitEntities)
{
    // key is group root, values is rest of group (split off entities)
    var rootMapping = _entityMappings.FindFirstByKey(kvp.Key);
    var targetFieldsMappedInRoot = rootMapping.GetAllMappedFieldTargets();
    foreach(var splitOffEntity in kvp.Value)
    {
        var splitOffMapping = _entityMappings.FindFirstByKey(splitOffEntity);
        var fieldsNotMappedInRoot = splitOffMapping.GetAllMappedFieldTargets().Except(targetFieldsMappedInRoot);
        // each field in fieldsNotMappedInRoot now has to be nullable. 
        foreach(var splitOfTargetField in splitOffMapping.GetAllMappedFieldsForGivenTargets(fieldsNotMappedInRoot, false))
        {
            if(!splitOfTargetField.IsOptional)
            {
                // error.
                toReturn = false;
                EntityDefinition involvedEntity = splitOffEntity;
                EntityDefinition involvedRootEntity = kvp.Key;
                string involvedFieldPath = splitOfTargetField.PathAsString;
                MessageManagerSingleton.GetInstance().DispatchMessage(
                    new ErrorMessage(involvedEntity.FullName, true,
                                     &amp;quot;For the database with driver '{0}', the field '{1}' in entity '{2}' isn't marked as optional, while its containing entity is a split-off entity of entity '{3}' which doesn't have this field mapped.&amp;quot;
                                        .AsFormatted(dbDescription, involvedFieldPath, involvedEntity.FullName, involvedRootEntity.FullName))
                        .AddCorrection(&amp;quot;Open entity '{0}' in its editor and manually mark the field as Optional or otherwise correct the error.&amp;quot;.AsFormatted(involvedEntity.FullName),
                                       1, () =&amp;gt; MessageManagerSingleton.GetInstance().RaiseGoLocationRequested(involvedEntity.CreateSourceLocationDataObject())));
            }
        }
    }
}&lt;/pre&gt;

&lt;p&gt;In the code above you'll also see a glimpse of the designer's internal message system. This message system is central hub which receives messages from all kinds of classes and which dispatches them in a central queue. This queue is then visualized in the UI by a form. The advantage of this system is that everywhere in the core system (so that's not the UI, it has no awareness of the UI), you can dispatch an error to the UI without knowing there is a UI. Furthermore, you can attach corrections. These are displayed below the error / warning and the user can click a link to activate the correction, for example it can open an editor for you to go to the location where the error was, but it can also offer you a correction immediately, for example by removing an element directly. It gets you a high de-coupling between elements which otherwise wouldn't have a relationship anyway and also gets you an easy way to 'break out' a deep object hierarchy so you don't have to pass back elements up the call chain.&lt;/p&gt;

&lt;p&gt;It's things like this which will give you high productivity without a lot of effort. Oh, and Linq + lambda's of course. But you already noticed that from the code snippets I guess. &lt;img src="http://www.xs4all.nl/~perseus/smileys/smileywink.gif" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.llblgen.com" target="_blank"&gt;LLBLGen Pro&lt;/a&gt; v3.0 is slated to hit its first beta in January 2010.&amp;#160; &lt;/p&gt;</description></item><item><title>Very odd OutOfMemoryException issue with GetHashCode(string)</title><link>http://weblogs.asp.net/fbouma/archive/2009/12/02/very-odd-outofmemoryexception-issue-with-gethashcode-string.aspx</link><pubDate>Wed, 02 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7268553</guid><dc:creator>FransBouma</dc:creator><author>FransBouma</author><description>&lt;p&gt;In .NET there's a class called StringComparer. It has some handy helpers, like the InvariantCultureIgnoreCase StringComparer. These classes also implement a method called GetHashCode(string), which produces the hashcode in the scope of the comparer, so if you're calling that method on the InvariantCultureIgnoreCase variant, you get the hashcode for that scope. &lt;/p&gt;  &lt;p&gt;This is handy as hashcodes are important, for example to find duplicates. We recently ran into an issue with this, as passing a large string to this method caused it to throw an OutOfMemoryException, but ... there was plenty of memory left. What was even stranger was that the length of the string differs per appdomain and even machine!&lt;/p&gt;  &lt;p&gt;So I wrote a little app, sourcecode is below. It fiddles with digits to find the maximum string length one can pass to GetHashCode before it throws this exception. Of course, this is of little use, but it illustrates the problem and is a good repro-case for Microsoft as well. The code below will crash with an OutOfMemoryException as it will test the found length by increasing it with 1. I'll post this to Connect (yes, I'm that naive, but perhaps this time they'll fix it). Tested on .NET 3.5 SP1 and XP sp3 as well as .NET 2.0 and XP sp3 (I'm pretty sure the error is in Win32, so it might be OS dependent even).&lt;/p&gt;  &lt;pre class="c#" name="code"&gt;using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace OOMTester
{
    public class Program
    {
        static void Main(string[] args)
        {
            int digitIndex = 0;
            char[] digits = new char[8];
            StringComparer comparer = StringComparer.InvariantCultureIgnoreCase;
            while(digitIndex&amp;lt;digits.Length)
            {
                for(int i=9;i&amp;gt;=0;i--)
                {
                    digits[digitIndex] = i.ToString()[0];
                    for(int j=digitIndex+1;j&amp;lt;digits.Length;j++)
                    {
                        digits[j] = '0';
                    }
                    int length = Convert.ToInt32(new string(digits));
                    bool succeeded = false;
                    try
                    {
                        int hashCode = comparer.GetHashCode(new string('X', length));
                        succeeded = true;
                    }
                    catch(OutOfMemoryException)
                    {
                        // failed.
                    }
                    catch(ArgumentException)
                    {
                        // out of range
                    }
                    if(succeeded)
                    {
                        digitIndex++;
                        Console.WriteLine(&amp;quot;Digit index increased: {0}. Full digits: {1}&amp;quot;, 
                                    digitIndex, new string(digits));
                        break;
                    }
                }
            }

            Console.WriteLine(&amp;quot;MaxLength: {0}&amp;quot;, new string(digits));

            int maxLength = Convert.ToInt32(new string(digits));
            string xmlData = new string('X', maxLength);
            int hashcode = comparer.GetHashCode(xmlData);
            Console.WriteLine(&amp;quot;Length: {0}. Hashcode: {1}&amp;quot;, xmlData.Length, hashcode);
            maxLength++;
            xmlData = new string('X', maxLength);
            hashcode = comparer.GetHashCode(xmlData);
            Console.WriteLine(&amp;quot;Length: {0}. Hashcode: {1}&amp;quot;, xmlData.Length, hashcode);
        }
    }
}&lt;/pre&gt;

&lt;p&gt;
  &lt;br /&gt;&lt;b&gt;Update&lt;/b&gt;: &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=517457" target="_blank"&gt;Connect issue&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Explanation of Raid levels</title><link>http://weblogs.asp.net/israelio/archive/2009/11/23/explanation-of-raid-levels.aspx</link><pubDate>Mon, 23 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7263301</guid><dc:creator>israelio</dc:creator><author>israelio</author><description>&lt;p&gt;While reordering some of my old hard drives I found this Image which I do not recall did where I get it from… &lt;em&gt;I&lt;/em&gt;t is funny little one explaining the basics about Raid levels.&lt;/p&gt;  &lt;p&gt;Enjoy :-)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/israelio/raid_4E187731.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="raid" border="0" alt="raid" src="http://weblogs.asp.net/blogs/israelio/raid_thumb_7A91814A.jpg" width="541" height="420" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>&amp;quot;Cloud Cloud Cloud, if you're not in it, you're out!&amp;quot;... or something</title><link>http://weblogs.asp.net/fbouma/archive/2009/11/18/quot-cloud-cloud-cloud-if-you-re-not-in-it-you-re-out-quot-or-something.aspx</link><pubDate>Wed, 18 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7258960</guid><dc:creator>FransBouma</dc:creator><author>FransBouma</author><description>&lt;p&gt;After I graduated from the HIO Enschede (B.Sc level) in '94 I have worked with a lot of different platforms and environments: from 4GL's like System Builder, uniVerse and Magic to C++ on AIX to Java to Perl on Linux to C# on .NET. All these platforms and environments had one thing in common: their creators were convinced their platform was the best and greatest and easiest to write software with. To some extend, each and every one of them were decent platforms and it was perfectly possible to write software with them though I'll leave the classification whether they were / are the greatest and easiest to the reader. I'll try to make clear below why this dull intro is important. &lt;/p&gt;  &lt;p&gt;Yesterday I watched the live stream of the &lt;a href="http://microsoftpdc.com" target="_blank"&gt;PDC '09&lt;/a&gt; keynote and in general it made me feel uncomfortable but I couldn't really figure out why. This morning I realized what it was and I'll try to explain it in this blog. &lt;/p&gt;  &lt;h4&gt;Cloudy skies&lt;/h4&gt;  &lt;p&gt;If one word was used more often than anything else in the keynote it was likely the word 'cloud'. Cloud, cloud, cloud, azure, cloud, cloud, azure, cloud, azure... and so on. Perhaps it's the weather in Seattle which made Microsoft fall so in love with clouds, I don't know, but all this cloud-love made me a little uneasy. This morning I woke up and realized why: it's too foggy. You see, the whole time I was watching the keynote, I had the idea I was watching the keynote of some conference about some science I have no knowledge about whatsoever. &lt;/p&gt;  &lt;p&gt;&amp;quot;Cool, another guy talking about azure clouds with yet another set of fancy UIs I've never seen, giving me the feeling that not using those is equal to 'doing it wrong', but what the heck azure clouds are and what problem they're solving is beyond me&amp;quot;. That kind of thing. &lt;/p&gt;  &lt;p&gt;A long line of people were summoned on stage to tell something about some great tool / framework / idea / wizardry related to clouds and with every person I more and more lost grip about what &lt;strong&gt;problem&lt;/strong&gt; they all wanted to solve. All I saw was a long line of examples of Yet Another Platform with its own set of maintenance characteristics, maintenance UIs, maintenance &lt;em&gt;overhead&lt;/em&gt; and thus maintenance nightmares. &lt;/p&gt;  &lt;p&gt;More UIs, more aspects about things which were apparently new to software engineering nevertheless utterly essential to writing good software... more UIs I've never seen before, more cloudy weather, more azure flavors, more UIs I've never seen, more... &lt;/p&gt;  &lt;p&gt;&amp;quot;Aaaaarrrgg!&amp;quot; &lt;img src="http://www.xs4all.nl/~perseus/smileys/smileyshocked.gif" /&gt; &lt;/p&gt;  &lt;p&gt;As I've tried to explain in the first paragraph, I've been around the block a couple of times. I have lived through internet bubbles, read McNealy's 'The Network is the computer' articles / propaganda, shaked my head when I heard about Ellison's Java client desktop idea, waded through the seas of SOA and SOA related hype material, so I have a bit of an idea what &amp;quot;Big computer with software somewhere + you&amp;quot; means. In this 'modern age' it's dubbed 'Cloud computing', though to me it looks like the same old idea that has been presented by various people in the past but with new labels. With all these platforms presented in the past, there was really one issue: what was the problem they all tried to solve? &lt;em&gt;Why&lt;/em&gt; would one want to use it? With Cloud computing, that same old issue hasn't been solved. &lt;/p&gt;  &lt;h4&gt;&amp;quot;I built it, you run it&amp;quot;&lt;/h4&gt;  &lt;p&gt;One aspect all these 'big computer with software + you' systems tried to sell was that they could run the software you wrote for you and you didn't have to worry about a thing. Well, not to worry about a lot, but still you had to worry about things, as the system was still Yet Another Platform with its own set of characteristics, flaws and weaknesses and most importantly: differences with the development- and test environment the software was written with. &lt;/p&gt;  &lt;p&gt;The problem with software once it is written, tested and ready for deployment is that last stage: will it run in the environment on-site the way it runs locally in the test environment? And is that on-site environment easy to maintain? &lt;/p&gt;  &lt;p&gt;In other words: the problem is that the environment the software has to run in isn't necessarily the same as the environment the software was written with / tested in, which could cause a lot of problems during deployment and after deployment. Other aspects like updating the environment due to security flaws, bugs in software etc. are also factors which add to the overall unpleasant experience of deploying and keeping software running.&lt;/p&gt;  &lt;p&gt;So the answer to that problem should be a system which provides the following things:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font color="#000000"&gt;The environment equal to the one the software was written and tested with&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font color="#000000"&gt;The resources to keep the software running when the software requires them.&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font color="#000000"&gt;The security that the software keeps running, no matter what.&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In other words: the software engineers built the software, tested it and defined the environment (as they've done that for development and testing anyway) and shipped that in one package, and at the place where the software has to run, that &lt;em&gt;exact&lt;/em&gt; same environment is provided, together with the resources required (like memory, cpu, a database connection). So &amp;quot;I built it, you run it&amp;quot;. How the environment is re-created isn't important, the important thing is that the exact same environment is provided to the software, 24/7. &lt;/p&gt;  &lt;h4&gt;Are EC2, Azure and other cloudware solving the problem?&lt;/h4&gt;  &lt;p&gt;No. They provide &lt;em&gt;Yet Another Platform&lt;/em&gt; but not &lt;em&gt;the same environment&lt;/em&gt;. As they're yet another platform, you've to develop for that platform. The most typical example for that is that the newly announced application server from Microsoft 'AppFabric', has &lt;em&gt;two&lt;/em&gt; flavors: one for Windows and one for Azure. Why would anyone care? Isn't it totally irrelevant for a system in the 'cloud' what software (or what hardware) it is running? All that matters is that it can provide the environment the developer asked for so the developer knows the software will run the way it was intended. &lt;/p&gt;  &lt;p&gt;Let's look at a typical example: a website of some company with a small database to serve the pages, a small forum and some other data-driven elements, not really complex. Today, this company has to hire some webspace somewhere, database space, bandwidth and most importantly: uptime. To make the web application run online, it has to match the rules set by the hosting environment. If that's a dedicated system, someone has to make sure the system contains all software the web application depends on, that the system is secure and stays that way. If it's a shared hosting environment, the web application has to obey the ISP's rules of hosted web applications, e.g. can use 100MB memory max., can't recycle more than 2 times in an hour etc. &lt;/p&gt;  &lt;p&gt;When Patching Tuesday arrives, and the web application runs on a dedicated server (be it a VM or dedicated hardware, doesn't matter), someone has to make sure that the necessary patches are installed, and that those patches don't break the application. Backups have to be made so if disaster happens, things can be restored. These all count as 'uptime' costs. &lt;/p&gt;  &lt;p&gt;With a VM somewhere on a big machine this doesn't change, you still have to make sure the VM offers the environment the application asks for. You still have to patch the OS if a patch for it is released, you still have to babysit the environment the application runs in or hire someone to do that for you, but it always involves manual labor to make sure the environment online is equal to the environment during development and testing.&lt;/p&gt;  &lt;p&gt;In the whole keynote I didn't hear a single argument how Microsoft Azure is doing this differently. Sure I can upload some application to some server and it is ran. However, not with the environment I ask for, but inside the environment Azure offers. That's a different thing, because it requires that the developer has to write software with Azure in mind. If I have a .NET web application running on a dedicated server which uses Oracle 10g R2 as its database and I want to 'cloudify' (&lt;img src="http://www.xs4all.nl/~perseus/smileys/smileywink.gif" /&gt;) that web application with Azure, I can't because I have to make all kinds of modifications, for example I have to drop the Oracle database for something else and also make other changes as the environment provided by Azure isn't the same as the one locally. &lt;/p&gt;  &lt;p&gt;EC2 and other cloudware do the same thing, they all provide 'an' environment with a set of characteristics, but not &lt;em&gt;your&lt;/em&gt; environment. So in other words, they're not solving the problem, they only add another platform to choose from when writing software. Like we didn't have enough of those already. Sure, they offer some room for scaling when it comes to resources, but what happens when the image has to reboot due to a security fix that had been installed? Is the application automatically moved to another OS instance? Without loss of &lt;em&gt;any&lt;/em&gt; data in-memory, so it looks like the application just ran along fine without any hiccup? &lt;/p&gt;  &lt;h4&gt;So what's the solution? What should Cloud computing be all about instead?&lt;/h4&gt;  &lt;p&gt;It should be about &lt;em&gt;environment virtualization&lt;/em&gt;. I give you a myapp.zip and an environment.config and you run it. And keep running it. All dependencies on software of my application, like 3rd party libraries, are enclosed in the application's image. That's not an image of an OS with the app installed, it's just the application. The environment.config file is a file which contains the description of the environment that the software wants, e.g. .NET 3.5 sp1, Oracle 10g R2 database, 2GB ram minimum, IIS7, domain name example.com registered to app, folder structure etc. etc. So I outsource any babysitting of the environment of my application.&lt;/p&gt;  &lt;p&gt;That is incredibly complex. It might not even be doable. But it's the only way to make cloud computing something else than a new name for an old idea, despite the long list of well-known names who showed an even longer list of UIs and tools during a keynote. &lt;/p&gt;  &lt;p&gt;Can Azure do what I described above? I honestly have not the faintest idea, even after watching the keynote yesterday and by reading up some marketing stuff. That doesn't give me confidence, as it's in general not a good sign if a vendor has a hard time explaining what &lt;em&gt;problem&lt;/em&gt; a product solves.&lt;/p&gt;</description></item><item><title>What's new in Visual C# 4.0 ?  - Part 1 - Optional parameters</title><link>http://weblogs.asp.net/israelio/archive/2009/10/27/what-s-new-in-visual-c-4-0-part-1.aspx</link><pubDate>Tue, 27 Oct 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7240509</guid><dc:creator>israelio</dc:creator><author>israelio</author><description>&lt;P&gt;This is the first blog from a series of blog post which I'm planning to do on whet’s new in Visual C# 4.0&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Optional parameters&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Optional parameters is a new feature in C# 4.0 which will let you set a default value for an argument of a method. In case that the collie of the method will omit the argument the default value will take its place.&lt;/P&gt;
&lt;P&gt;So instead of writing the following code:&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:b9a4fe88-2321-41dd-955f-d497c9fdc195 class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="BACKGROUND: #ddd; OVERFLOW: auto"&gt;
&lt;OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2.5em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; WHITE-SPACE: nowrap; BACKGROUND: #ffffff; PADDING-TOP: 0px"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;[] args)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SaySomething();&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SaySomething(&lt;SPAN style="COLOR: #a31515"&gt;"Ohad"&lt;/SPAN&gt;);&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.ReadLine();&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; SaySomething()&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Hi !"&lt;/SPAN&gt;);&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; SaySomething(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; name)&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;.Format(&lt;SPAN style="COLOR: #a31515"&gt;"Hi {0}!"&lt;/SPAN&gt;,name));&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;You will only have to write:&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:cf5519ae-a1c1-46a4-8a0c-64bfaca6864b class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="BACKGROUND: #ddd; OVERFLOW: auto"&gt;
&lt;OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2.5em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; WHITE-SPACE: nowrap; BACKGROUND: #ffffff; PADDING-TOP: 0px"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;[] args)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SaySomething();&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SaySomething(&lt;SPAN style="COLOR: #a31515"&gt;"Ohad"&lt;/SPAN&gt;);&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.ReadLine();&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; SaySomething(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; name = &lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;.Format(&lt;SPAN style="COLOR: #a31515"&gt;"Hi {0}!"&lt;/SPAN&gt;,name));&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The statement &lt;STRONG&gt;name = “” &lt;/STRONG&gt;at line 11 does the trick of the optional parameter with passing and empty string as the optional parameter.&lt;/P&gt;
&lt;P&gt;Note that some of the reader of this post my think that its better to use string.Empty instead of double quote “” as it normally do but :&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:eba4909b-7afb-44a9-99c1-e4b6871c74ba class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="PADDING-BOTTOM: 2px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; FONT-FAMILY: Verdana, Tahoma, Arial, sans-serif; BACKGROUND: #000080; COLOR: #fff; FONT-WEIGHT: bold; PADDING-TOP: 2px"&gt;Code Snippet&lt;/DIV&gt;
&lt;DIV style="BACKGROUND: #ddd; OVERFLOW: auto"&gt;
&lt;OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2.5em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; BACKGROUND: #ffffff; PADDING-TOP: 0px"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;[] args)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SaySomething();&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SaySomething(&lt;SPAN style="COLOR: #a31515"&gt;"Ohad"&lt;/SPAN&gt;);&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.ReadLine();&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; SaySomething(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; name = &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;.Empty)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;.Format(&lt;SPAN style="COLOR: #a31515"&gt;"Hi {0}!"&lt;/SPAN&gt;,name));&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;using string,Empty will result with a compilation error:&lt;/P&gt;
&lt;P&gt;“Default parameter value for 'name' must be a compile-time constant”&lt;/P&gt;
&lt;P&gt;And as it string.Empty is not a literal.&lt;/P&gt;</description></item><item><title>What’s new in Visual C# 4.0 ? – Part 3 - Dynamic ExpendoObject</title><link>http://weblogs.asp.net/israelio/archive/2009/10/27/what-s-new-in-visual-c-4-0-part-3.aspx</link><pubDate>Tue, 27 Oct 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7240857</guid><dc:creator>israelio</dc:creator><author>israelio</author><description>&lt;P&gt;This is the third post of what’s new in Visual Studio C# 4.0. &lt;/P&gt;
&lt;P&gt;At the former posts we covered &lt;A href="http://weblogs.asp.net/israelio/archive/2009/10/27/what-s-new-in-visual-c-4-0-part-1.aspx" mce_href="http://weblogs.asp.net/israelio/archive/2009/10/27/what-s-new-in-visual-c-4-0-part-1.aspx"&gt;optional parameters&lt;/A&gt;, &lt;A href="http://blogs.microsoft.co.il/blogs/ohad/archive/2009/10/27/what-s-new-in-visual-c-4-0-part-2.aspx" target=_blank mce_href="http://blogs.microsoft.co.il/blogs/ohad/archive/2009/10/27/what-s-new-in-visual-c-4-0-part-2.aspx"&gt;Named Parameters&lt;/A&gt; at this post we will cover C# Dynamics and ExpandoObject&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;dynamic &amp;amp; ExpendoObject&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;C# 1.0 introduced us to the managed world (based on Microsoft perception)&lt;/P&gt;
&lt;P&gt;C# 2.0 brought us Genetic types.&lt;/P&gt;
&lt;P&gt;C# 3.0 introduced us to new concept – LINQ&lt;/P&gt;
&lt;P&gt;C# 4.0 highlight is all about Dynamic Types&lt;/P&gt;
&lt;P&gt;Say for example that you have the need to create an object on the spot and use it in a local scope, without dynamic type you had to define a class and then create the object. you could do it at runtime using reflection emit, code dom etc…now its much simpler !&lt;/P&gt;
&lt;P&gt;All you have to do it to create an object of the type dynamic and using a special builder called ExpandoObject you can now define your object on the fly and use it.&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:27ab8310-efaa-4ab4-bb94-b2f19900ae1b class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="BACKGROUND: #ddd; OVERFLOW: auto"&gt;
&lt;OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2.5em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; BACKGROUND: #ffffff; PADDING-TOP: 0px"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;[] args)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #0000ff"&gt;dynamic&lt;/SPAN&gt; person = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ExpandoObject&lt;/SPAN&gt;(); &lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;person.Firstname=&lt;SPAN style="COLOR: #a31515"&gt;"ohad"&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI&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;person.Lastname = &lt;SPAN style="COLOR: #a31515"&gt;"israeli"&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.Firstname); &lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.Lastname);&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.ReadLine();&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;You may say… wow this is cool.. well wait and see some more cool stuff..&lt;/P&gt;
&lt;P&gt;Now lets add to this example and say that you would like to add a functionality to this object, what about adding person.Fullname in order to join the first and last name of the person and return it back.&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:e8b326ee-eb94-4988-951d-c878ad30758a class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="BACKGROUND: #ddd; MAX-HEIGHT: 300px; OVERFLOW: auto"&gt;
&lt;OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2.5em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; BACKGROUND: #ffffff; PADDING-TOP: 0px"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;[] args)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #0000ff"&gt;dynamic&lt;/SPAN&gt; person = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ExpandoObject&lt;/SPAN&gt;(); &lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;person.Firstname=&lt;SPAN style="COLOR: #a31515"&gt;"ohad"&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI&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;person.Lastname = &lt;SPAN style="COLOR: #a31515"&gt;"israeli"&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;person.Fullname = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Func&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;&amp;gt;(&lt;SPAN style="COLOR: #0000ff"&gt;delegate&lt;/SPAN&gt;() { &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; person.Firstname + &lt;SPAN style="COLOR: #a31515"&gt;" "&lt;/SPAN&gt; + person.Lastname; });&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.Firstname); &lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.Lastname);&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.Fullname());&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.ReadLine();&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;As you can see we can point the new object properties to lambda expressions such as Func&amp;lt;string&amp;gt; and define on the spot a function that will return the full name of the person.&lt;/P&gt;
&lt;P&gt;Note that on line 12 you need to call the function and not use it as property – person.Fullname()&lt;/P&gt;
&lt;P&gt;What will happen if you forget the () by the end of the function name ? (note the change on line 12)&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:42a0fd3a-9e21-49b8-a904-fc598f805fb8 class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="BACKGROUND: #ddd; MAX-HEIGHT: 300px; OVERFLOW: auto"&gt;
&lt;OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2.5em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; BACKGROUND: #ffffff; PADDING-TOP: 0px"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;[] args)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #0000ff"&gt;dynamic&lt;/SPAN&gt; person = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ExpandoObject&lt;/SPAN&gt;(); &lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;person.Firstname=&lt;SPAN style="COLOR: #a31515"&gt;"ohad"&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI&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;person.Lastname = &lt;SPAN style="COLOR: #a31515"&gt;"israeli"&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;person.Fullname = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Func&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;&amp;gt;(&lt;SPAN style="COLOR: #0000ff"&gt;delegate&lt;/SPAN&gt;() { &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; person.Firstname + &lt;SPAN style="COLOR: #a31515"&gt;" "&lt;/SPAN&gt; + person.Lastname; });&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.Firstname); &lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.Lastname);&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.Fullname);&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.ReadLine();&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result will be the lambda expression itself instead of the result of the lamba expression:&lt;/P&gt;
&lt;P&gt;ohad &lt;BR&gt;israeli &lt;BR&gt;System.Func`1[System.String]&lt;/P&gt;
&lt;P&gt;You can also add methods and not just functions using the Action expression: (note line 9)&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:f7a65cb0-2321-4c53-a1f0-a618a2ee393e class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="BACKGROUND: #ddd; OVERFLOW: auto"&gt;
&lt;OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2.5em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; BACKGROUND: #ffffff; PADDING-TOP: 0px"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;[] args)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #0000ff"&gt;dynamic&lt;/SPAN&gt; person = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ExpandoObject&lt;/SPAN&gt;(); &lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;person.Firstname=&lt;SPAN style="COLOR: #a31515"&gt;"ohad"&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI&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;person.Lastname = &lt;SPAN style="COLOR: #a31515"&gt;"israeli"&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;person.Fullname = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Func&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;&amp;gt;(&lt;SPAN style="COLOR: #0000ff"&gt;delegate&lt;/SPAN&gt;() { &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; person.Firstname + &lt;SPAN style="COLOR: #a31515"&gt;" "&lt;/SPAN&gt; + person.Lastname; });&lt;/LI&gt;
&lt;LI&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;person.CallOhad = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Action&lt;/SPAN&gt;(() =&amp;gt; { &lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Hi Ohad are you there ?"&lt;/SPAN&gt;); });&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.Firstname); &lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.Lastname);&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.Fullname());&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;/LI&gt;
&lt;LI&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;person.CallOhad();&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.ReadLine();&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;STRONG&gt;In conclusion dynamic types are cool but and there is a big but !&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;They are hard to debug and some of their functionality is only being tested at runtime this is why it is very important that whenever you use dynamic types test, test, and do some more testing using unit test of your code. &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If you follow the following code you will notice that each of the calls to the properties in lines 11,12,13 begins with a small letter instead of uppercase.&amp;nbsp; This code will compile without any errors but of course the code will fail at runtime as the properties / function names are all uppercase.&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:5b0d2542-3507-43c3-9e7b-b286310f6a42 class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="BACKGROUND: #ddd; OVERFLOW: auto"&gt;
&lt;OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2.5em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; BACKGROUND: #ffffff; PADDING-TOP: 0px"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;[] args)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #0000ff"&gt;dynamic&lt;/SPAN&gt; person = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ExpandoObject&lt;/SPAN&gt;(); &lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;person.Firstname=&lt;SPAN style="COLOR: #a31515"&gt;"ohad"&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI&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;person.Lastname = &lt;SPAN style="COLOR: #a31515"&gt;"israeli"&lt;/SPAN&gt;;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;person.Fullname = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Func&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;&amp;gt;(&lt;SPAN style="COLOR: #0000ff"&gt;delegate&lt;/SPAN&gt;() { &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; person.Firstname + &lt;SPAN style="COLOR: #a31515"&gt;" "&lt;/SPAN&gt; + person.Lastname; });&lt;/LI&gt;
&lt;LI&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;person.CallOhad = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Action&lt;/SPAN&gt;(() =&amp;gt; { &lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Hi Ohad are you there ?"&lt;/SPAN&gt;); });&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.firstname); &lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.lastname);&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(person.fullname());&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;/LI&gt;
&lt;LI&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;person.CallOhad();&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.ReadLine();&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description></item><item><title>What's new in Visual C# 4.0 ? - Part 2 - Names Parameters</title><link>http://weblogs.asp.net/israelio/archive/2009/10/27/what-s-new-in-visual-c-4-0-part-2.aspx</link><pubDate>Tue, 27 Oct 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7240573</guid><dc:creator>israelio</dc:creator><author>israelio</author><description>&lt;P&gt;This is the second post of what’s new in Visual Studio C# 4.0. &lt;/P&gt;
&lt;P&gt;At the former post we reviewed the feature of &lt;A href="http://weblogs.asp.net/israelio/archive/2009/10/27/what-s-new-in-visual-c-4-0-part-1.aspx" target=_blank mce_href="http://weblogs.asp.net/israelio/archive/2009/10/27/what-s-new-in-visual-c-4-0-part-1.aspx"&gt;optional parameters&lt;/A&gt; at this post we will concentrate on Named Parameters.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Named Parameters&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Lets assume you are writing the following procedure :&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:bb321d02-ff82-4112-b596-38c02caebf16 class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="BACKGROUND: #ddd; OVERFLOW: auto"&gt;
&lt;OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; BACKGROUND: #ffffff; PADDING-TOP: 0px"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; SaySomething(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; name, &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; msg)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;.Format(&lt;SPAN style="COLOR: #a31515"&gt;"Hi {0} !\n{1}"&lt;/SPAN&gt;, name,msg));&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;When you want to call it from your code you are using something like:&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:78743cdb-babd-4d79-8057-1f3a1b918c55 class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="PADDING-BOTTOM: 2px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; FONT-FAMILY: Verdana, Tahoma, Arial, sans-serif; BACKGROUND: #000080; COLOR: #fff; FONT-WEIGHT: bold; PADDING-TOP: 2px"&gt;Code Snippet&lt;/DIV&gt;
&lt;DIV style="BACKGROUND: #ddd; MAX-HEIGHT: 300px; OVERFLOW: auto"&gt;
&lt;OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; BACKGROUND: #ffffff; PADDING-TOP: 0px"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;[] args)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SaySomething(&lt;SPAN style="COLOR: #a31515"&gt;"Ohad"&lt;/SPAN&gt;,&lt;SPAN style="COLOR: #a31515"&gt;"What's up?"&lt;/SPAN&gt;);&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.ReadLine();&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;What’s the problem ?&lt;/P&gt;
&lt;P&gt;Although you will have intellisense while you are coding it for the reader of the code its unclear what is the first parameter and what is the second parameter.&lt;/P&gt;
&lt;P&gt;This is where Named Parameters gets into the picture. Using named parameter the code becomes much more readable to one who haven’t wrote it.&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:c3acc8a6-81ee-4bf0-8634-9e217c3508ce class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="PADDING-BOTTOM: 2px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; FONT-FAMILY: Verdana, Tahoma, Arial, sans-serif; BACKGROUND: #000080; COLOR: #fff; FONT-WEIGHT: bold; PADDING-TOP: 2px"&gt;Code Snippet&lt;/DIV&gt;
&lt;DIV style="BACKGROUND: #ddd; MAX-HEIGHT: 300px; OVERFLOW: auto"&gt;
&lt;OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2.5em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; BACKGROUND: #ffffff; PADDING-TOP: 0px"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;[] args)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SaySomething(name: &lt;SPAN style="COLOR: #a31515"&gt;"Ohad"&lt;/SPAN&gt;, msg: &lt;SPAN style="COLOR: #a31515"&gt;"What's up?"&lt;/SPAN&gt;);&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.ReadLine();&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; SaySomething(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; name, &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; msg)&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;.Format(&lt;SPAN style="COLOR: #a31515"&gt;"Hi {0} !\n{1}"&lt;/SPAN&gt;, name,msg));&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Named parameters are specially useful whenever you have multiple optional parameters of the same type. Without using named parameter how would the compiler know if the parameter which is being passed by line 5 is the name or the message.&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:d1b8da09-4c97-4cbe-a6b6-7d95a1de394f class=wlWriterEditableSmartContent&gt;
&lt;DIV style="BORDER-BOTTOM: #000080 1px solid; BORDER-LEFT: #000080 1px solid; FONT-FAMILY: 'Courier New', Courier, Monospace; COLOR: #000; FONT-SIZE: 10pt; BORDER-TOP: #000080 1px solid; BORDER-RIGHT: #000080 1px solid"&gt;
&lt;DIV style="PADDING-BOTTOM: 2px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; FONT-FAMILY: Verdana, Tahoma, Arial, sans-serif; BACKGROUND: #000080; COLOR: #fff; FONT-WEIGHT: bold; PADDING-TOP: 2px"&gt;Code Snippet&lt;/DIV&gt;
&lt;DIV style="BACKGROUND: #ddd; MAX-HEIGHT: 300px; OVERFLOW: auto"&gt;
&lt;OL style="PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 2.5em; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; BACKGROUND: #ffffff; PADDING-TOP: 0px"&gt;
&lt;LI&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;[] args)&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI&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;SaySomething(name: &lt;SPAN style="COLOR: #a31515"&gt;"Ohad"&lt;/SPAN&gt;);&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&lt;/LI&gt;
&lt;LI&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.ReadLine();&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; SaySomething(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; name = &lt;SPAN style="COLOR: #a31515"&gt;"Tirza"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; msg = &lt;SPAN style="COLOR: #a31515"&gt;"Hi There"&lt;/SPAN&gt;)&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&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;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;.Format(&lt;SPAN style="COLOR: #a31515"&gt;"Hi {0} !\n{1}"&lt;/SPAN&gt;, name,msg));&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;
&lt;LI style="BACKGROUND: #f3f3f3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description></item><item><title>Free training on Visual Studio 2010 and C# 4.0</title><link>http://weblogs.asp.net/israelio/archive/2009/10/27/free-training-on-visual-studio-2010-and-c-4-0.aspx</link><pubDate>Tue, 27 Oct 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7240875</guid><dc:creator>israelio</dc:creator><author>israelio</author><description>&lt;p&gt;Did you know that you can train yourself for what’s new in Visual Studio 2010 and C# 4.0 (also VB) ?&lt;/p&gt;  &lt;p&gt;The &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732-A383-ED5740F02E93&amp;amp;displaylang=en" target="_blank"&gt;Microsoft Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview&lt;/a&gt; is available for more than a week now and it includes lots of slide decks, demos and labs covering the following topics:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Whats New In the .NET Framework 4&lt;/li&gt;    &lt;li&gt;Whats New In Visual Studio 2010&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Video: Downloading And Installing Visual Studio 2010 Beta 2&lt;/li&gt;      &lt;li&gt;Demo: Hello Visual Studio 2010&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Common Language Runtime&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Demo: System.Threading.Barrier Demo &lt;/li&gt;      &lt;li&gt;Demo: System.Threading.CountdownEvent &lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt; Managed Languages&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;What's New In C# 4 and Visual Basic 10 &lt;/li&gt;      &lt;li&gt;Video: Fixing PIA Pains with Type Equivalence&lt;/li&gt;      &lt;li&gt;Demo: Managed Languages 10-in-1 &lt;/li&gt;      &lt;li&gt;Lab: Introduction To F#&lt;/li&gt;      &lt;li&gt;Lab: Visual Studio 2010: Office Programmability&lt;/li&gt;      &lt;li&gt;Lab: Visual Studio 2010: Test Driven Development&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt; ASP.NET 4&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Introduction to ASP.NET MVC&lt;/li&gt;      &lt;li&gt;Whats New In ASP.NET AJAX 4&lt;/li&gt;      &lt;li&gt;Whats New In ASP.NET Web Forms 4&lt;/li&gt;      &lt;li&gt;Web Deployment with Visual Studio 2010&lt;/li&gt;      &lt;li&gt;Video: Simplifying Data-Driven Web Applications&lt;/li&gt;      &lt;li&gt;Demo: AdventureWorks using AJAX &lt;/li&gt;      &lt;li&gt;Demo: ASP.NET AJAX 10-in-1 &lt;/li&gt;      &lt;li&gt;Lab: ASP.NET AJAX&lt;/li&gt;      &lt;li&gt;Lab: Building an Web Application&lt;/li&gt;      &lt;li&gt;Lab: Enhancing a Web Application&lt;/li&gt;      &lt;li&gt;Lab: Introduction to ASP.NET Web Forms 4.0&lt;/li&gt;      &lt;li&gt;Lab: Web Development in Visual Studio 2010&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Windows&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;What's New in Windows Presentation Foundation 4&lt;/li&gt;      &lt;li&gt;Lab: Building a Data-Driven Master/Detail Business Form in WPF using Visual Studio 2010&lt;/li&gt;      &lt;li&gt;Lab: Taskbar - MFC&lt;/li&gt;      &lt;li&gt;Lab: Gestures - MFC&lt;/li&gt;      &lt;li&gt;Lab: Multitouch - MFC&lt;/li&gt;      &lt;li&gt;Lab: Ribbon – MFC&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Windows Workflow&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Workflow 4: A First Look&lt;/li&gt;      &lt;li&gt;Video: Workflow Web Services&lt;/li&gt;      &lt;li&gt;Lab: Introduction to Workflow 4.0&lt;/li&gt;      &lt;li&gt;Lab: WCF Service Discovery using .NET Framework 4.0&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Windows Communication Foundation&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Lab: WCF Service Discovery using .NET Framework 4.0&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Silverlight&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Introduction to .NET RIA Services&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Data Access&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Whats New In Entity Framework 4&lt;/li&gt;      &lt;li&gt;Whats New In ADONET Data Services 1.5&lt;/li&gt;      &lt;li&gt;Introduction to Project &amp;quot;Velocity&amp;quot;&lt;/li&gt;      &lt;li&gt;Video: Server-Driven Paging with ADO.NET Data Services&lt;/li&gt;      &lt;li&gt;Demo: Project Velocity &lt;/li&gt;      &lt;li&gt;Lab: Introduction to ADO.NET Data Services&lt;/li&gt;      &lt;li&gt;Lab: Introduction To Project &amp;quot;Velocity&amp;quot;&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Parallel Computing&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Parallel Computing for Managed Developers&lt;/li&gt;      &lt;li&gt;Demo: ContosoAutomotive Demo&lt;/li&gt;      &lt;li&gt;Demo: BabyNames &lt;/li&gt;      &lt;li&gt;Demo: Parallel.For Loop &lt;/li&gt;      &lt;li&gt;Demo: Parallel LINQ (PLINQ) &lt;/li&gt;      &lt;li&gt;Demo: System.Threading.Tasks &lt;/li&gt;      &lt;li&gt;Lab: Parallel Extensions: Building Multicore Applications with .NET&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Extensibility&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Introduction to the Managed Extensibility Framework&lt;/li&gt;      &lt;li&gt;Video: MEF Preview 7&lt;/li&gt;      &lt;li&gt;Demo: Demos for &amp;quot;Intro to Mef&amp;quot; Presentation &lt;/li&gt;      &lt;li&gt;Lab: Introduction To Managed Extensibility Framework&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Application Lifecycle Management&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Download the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732-A383-ED5740F02E93&amp;amp;displaylang=en" target="_blank"&gt;Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://channel9.msdn.com/learn/courses/vs2010/" target="_blank"&gt;Channel 9 also hosting lots of VS 2010 &amp;amp; .NET 4.0 Training classes&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Download Visual Studio 2010 Beta 2 (No need for MSDN)</title><link>http://weblogs.asp.net/israelio/archive/2009/10/22/download-visual-studio-2010-beta-2-no-need-for-msdn.aspx</link><pubDate>Thu, 22 Oct 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7235555</guid><dc:creator>israelio</dc:creator><author>israelio</author><description>&lt;p&gt;As for today you can download Visual Studio 2010 Beta 2 even if you don’t have access to MSDN.&lt;/p&gt;  &lt;p&gt;Just follow the links below and download your favorite version.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Visual Studio&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165573"&gt;Visual Studio 2010 Ultimate (web bootstrapper)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165572"&gt;Visual Studio 2010 Ultimate (.ISO)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165570"&gt;Visual Studio 2010 Premium (web bootstrapper)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165569"&gt;Visual Studio 2010 Premium (.ISO)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165568"&gt;Visual Studio 2010 Professional (web bootstrapper)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165567"&gt;Visual Studio 2010 Professional (.ISO)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165599"&gt;Visual Studio 2010 Remote Debugger&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Visual Studio Extensibility&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165559"&gt;Visual Studio 2010 Shell (Integrated - redistributable .EXE)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165560"&gt;Visual Studio 2010 Shell (Isolated - redistributable .EXE)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165597"&gt;Visual Studio 2010 SDK (.EXE)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165598"&gt;Visual Studio 2010 DSL SDK (.EXE)&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;.NET Framework&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165586"&gt;.NET Framework 4 (web bootstrapper)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165593"&gt;.NET Framework 4 Client Profile (web bootstrapper)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165587"&gt;.NET Framework 4 (redistributable .EXE)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165594"&gt;.NET Framework 4 Client Profile (redistributable .EXE)&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Team Foundation Server&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165580"&gt;Visual Studio Team Foundation Server (.ISO)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165583"&gt;Visual Studio Team Explorer (.ISO)&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Test Products&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165576"&gt;Visual Studio Test Elements (.ISO)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165579"&gt;Visual Studio Team Lab Management&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=165574"&gt;Visual Studio Team Agents (.ISO)&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Express&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=167868"&gt;Visual Basic Express (.EXE)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=167871"&gt;Visual C++ Express (.EXE)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=167872"&gt;Visual C# Express (.EXE)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=167874"&gt;Visual Web Developer Express (.EXE)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=167878"&gt;Express Combo DVD (.ISO)&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;</description></item></channel></rss>