Null propagating operator in C#
C# 6.0 introduces language feature called null propagation. It’s about avoiding all this if-else mess in most sanity checks that avoid NullReferenceException.Of course, null checks can be found also from other parts of code that doesn’t necessarily deal with sanity checks. Let’s see how new null propagation feature help us write cleaner code.
ASP.NET 5: Using POCO controllers
ASP.NET 5 supports POCO controllers. Yes, controller classes that doesn’t extend Controller base class. These controllers look a little bit different by some small aspects and sometimes we may need to help framework detect our POCO controllers. This posting gives you complete overview of POCO controllers in next ASP.NET.
C#: Expression-bodied members
New C# introduces expression-bodied members of classes. Instead of property or method that makes some simple calculation we can define expressions and keep our code shorter. Nice thing is – also other .NET languages are able to use these new members. Let’s see what we can do with expression-bodied members in C#.
ASP.NET 5: Using shared sources
ASP.NET 5 supports code sharing between projects. It’s not about referencing libraries or something related to portable libraries – it’s different. Libraries can share their source that is compiled to referencing project output. In this posting I will show you how this new source sharing system works.
ASP.NET 5: New configuration files and containers
With ASP.NET vNext we get also new config files. Yes, files, because more than one config file format is supported. Our configuration can be JSON, INI or XML and I’m sure you can write configuration handlers that support your own custom formats. Also support for multiple configuration containers is here. In this posting I will show how new configuration system works in ASP.NET vNext.
Auto-property initializers in C#
Automatic properties is good feature in C# as we don’t have to declare variables for property values in our code. Instead we move this responsibility to compiler that automatically generated hidden backing field for property. New C# solves another problem – assigning default values to automatic properties.