[{"data":1,"prerenderedAt":211},["ShallowReactive",2],{"article-auto-implemented-properties-c-net-3-0":3},{"article":4,"tags":60,"previous":61,"next":138},{"id":5,"title":6,"author":7,"body":8,"createdAt":49,"description":50,"extension":51,"img":43,"meta":52,"navigation":53,"path":54,"seo":55,"stem":56,"tags":57,"updatedAt":49,"__hash__":59},"articles\u002Farticles\u002Fauto-implemented-properties-c-net-3-0.md","Auto-Implemented Properties c# .NET 3.0+","[object Object]",{"type":9,"value":10,"toc":46},"minimark",[11,28,35],[12,13,14,15,18,19,21,22,24,25,27],"p",{},"Instead of the following typical property setter\u002Fgetter  private string courseName;",[16,17],"br",{},"\npubic string CourseName{",[16,20],{},"\n   get { return courseName;}",[16,23],{},"\n   set { courseName = value;}",[16,26],{},"\n}   ",[12,29,30,34],{},[31,32,33],"strong",{},"Auto-Implemented"," property implicitly creates an instance variable for property CourseName",[12,36,37,38,40],{},"public string CourseName {get; set;}      * unable to use the private variable for this property (hidden from developer)     * developer can only reference within the class via CourseName     This is a reasonable approach for quick prototyping of properties only.",[16,39],{},[41,42],"img",{"src":43,"alt":44,"style":45},"\u002Farticles\u002Fimages\u002Fauto.jpg","","display:none;",{"title":44,"searchDepth":47,"depth":47,"links":48},2,[],"2015-04-20T08:07:17.6400000-04:00","Instead of the following typical property setter\u002Fgetter  private string courseName;\npubic string CourseName{\n   get { return courseName;}\n   set { courseName = value;}\n}   ","md",{},true,"\u002Farticles\u002Fauto-implemented-properties-c-net-3-0",{"title":6,"description":50},"articles\u002Fauto-implemented-properties-c-net-3-0",[58],".NET Features","xJ45NgU91LY4F4gvHzxbOH5uIutSNLauJCo5Oy2KAII",[],{"id":62,"title":63,"author":7,"body":64,"createdAt":129,"description":130,"extension":51,"img":126,"meta":131,"navigation":53,"path":132,"seo":133,"stem":134,"tags":135,"updatedAt":129,"__hash__":137},"articles\u002Farticles\u002Fanonymous-objects-or-types-net-3-0.md","Anonymous Objects or Types (.NET 3.0+ )",{"type":9,"value":65,"toc":127},[66,69,91,94,97,100,118,121],[12,67,68],{},"Details...",[70,71,72,76,79,82,85,88],"ul",{},[73,74,75],"li",{},"an anonymous type declaration begins with the new keyword followed by a member-initializer list in braces {}",[73,77,78],{},"the compiler generates a new class definition that contains the properties specified in the new member-initializer list",[73,80,81],{},"all properties of an anonymous type are public and immutable  * anonymous type properties are read-only (you cannot modify a properties value once the object is created)",[73,83,84],{},"each property's type is inferred from the values assigned to it",[73,86,87],{},"the compiler defines a ToString method that returns comma-separated list of property-name = value pairs",[73,89,90],{},"Equals method compares the properties of two or more anonymous types",[12,92,93],{},"Examples...  \u002F\u002FCreate a 'person' object using an anonymous type",[12,95,96],{},"var bob = new { Name = \"Bob\", Age = 37 };",[12,98,99],{},"bob in this case is the anonymous type, and the types of the properties are inferred by the value assigned.  \u002F\u002Fdisplay information (note here however that the ToString is not required as a ToString method is automatically defined and is the anonymous type)",[12,101,102,103,105,106,108,109,111,112,114,115,117],{},"Console.WriteLine(\"Bob:\" + bob.ToString());",[16,104],{},"\n\u002F\u002Fthe ToString() method would output the following",[16,107],{},"\nBob: { Name = Bob, Age = 37 }",[16,110],{},"\nvar steve = new { Name = \"Steve\", Age = 36 };",[16,113],{},"\n\u002F\u002Fthe compiler is able to recognize the anonymous type for bob and steve are identical and of the same class by the fact that the properties and types were\nidentical for both bob and steve",[16,116],{},"\n\u002F\u002Fthe anonymous type also creates an equals method that is capable of comparing all objects of this anonymous\ntype (so name and age properties will be compared)",[12,119,120],{},"Console.WriteLine(bob.Equals(steve) ? \"equal\" : \"not equal\"));",[12,122,123,124],{},"The output from the is \"not equal\".",[41,125],{"src":126,"alt":44,"style":45},"\u002Farticles\u002Fimages\u002Fanonymous.jpg",{"title":44,"searchDepth":47,"depth":47,"links":128},[],"2015-04-20T08:07:17.7300000-04:00","Anonymous types.",{},"\u002Farticles\u002Fanonymous-objects-or-types-net-3-0",{"title":63,"description":130},"articles\u002Fanonymous-objects-or-types-net-3-0",[136],"NETFeatures","cGVbO2z6ACthfgTvN4W5MWa6AETH2I_6hrC8J6udoNU",{"id":139,"title":140,"author":7,"body":141,"createdAt":201,"description":202,"extension":51,"img":203,"meta":204,"navigation":53,"path":205,"seo":206,"stem":207,"tags":208,"updatedAt":201,"__hash__":210},"articles\u002Farticles\u002Fenterprise-library-components-4-1-contents-of-the-download.md","Enterprise Library Components 4.1 (Contents of the download)",{"type":9,"value":142,"toc":199},[143,146,151,154,165,168,188],[12,144,145],{},"The default installation folder C:\\Program Files\\Microsoft Enterprise Library 4.1 - October 2008",[70,147,148],{},[73,149,150],{},"Bin - contains the binaries you can use in the application. ",[12,152,153],{},"Also, the configuration editor EntLibConfig.exe which can be used to create and edit configuration files for EntLib",[70,155,156,159,162],{},[73,157,158],{},"Docs - documentation",[73,160,161],{},"Src - contains the installer file for the Enterprise Library source file",[73,163,164],{},"Visual Studio Integration - contains binaries that make the configuration Editor available in Visual Studio",[12,166,167],{},"The installer also puts the original source code in C:\\EntLib41Src",[70,169,170,173,179,182,185],{},[73,171,172],{},"bin - contains the same as the bin above",[73,174,175,176,178],{},"Blocks - contains a solution that houses all 42 Enterprise Library projects. There is also a second solution that additionally contains unit test projects,\nand the actual unit tests to verify correct working of Enterprise Library as you change it.",[16,177],{},"This is a great value that allows you to feel comfortable editing this pile of code while being able to prove you have not broken anything",[73,180,181],{},"Lib - contains object builder and unity binaries that you can use in your application independent of EntLib",[73,183,184],{},"Quick Starts - contains sample code in both C# and VB.NET that you can use to see available functionality of EntLib and how to use it in your own applications.",[73,186,187],{},"Scripts - contains batch files to amongst others compile EntLib from the source, register assemblies and to install Northwind database for the quick starts",[12,189,190,191,195],{},"Enteprise Library 4.1 can be found ",[192,193],"a",{"title":194,"href":194},"http:\u002F\u002Fmsdn.microsoft.com\u002Fen-us\u002Flibrary\u002Fdd203099.aspx",[192,196,194],{"href":194,"rel":197},[198],"nofollow",{"title":44,"searchDepth":47,"depth":47,"links":200},[],"2015-04-20T08:07:17.5500000-04:00","Learn about Microsoft Enterprise Library","\u002Farticles\u002Fimages\u002FwnzEaKNdyZ.png",{},"\u002Farticles\u002Fenterprise-library-components-4-1-contents-of-the-download",{"title":140,"description":202},"articles\u002Fenterprise-library-components-4-1-contents-of-the-download",[209],"enterpriselibrary","VPzkUCTzFlbTNRdwVqnyU6p2PWmCgYjJgbGSKWQNA1E",1781574771702]