Below are some features that may be a part of C#.6 and VB.12. For current information visit Language feature implementation status for Dev14
Feature status as of 10/3/2014:
Feature
Example
C#
VB
Primary constructors
class Point(int x, int y) { … }
No
Auto-property initializers
public int X { get; set; } = x;
Done
Exists
Getter-only auto-properties
public int Y { get; } = y;
Ctor assignment to getter-only autoprops
Y = 15
Parameterless struct ctors
Structure S : Sub New() : End Sub : End Structure
Using static members
using System.Console; … Write(4);
Dictionary initializer
new JObject { ["x"] = 3, ["y"] = 7 }
Indexed member initializer
new JObject { $x = 3, $y = 7 }
Indexed member access
c.$name = c.$first + " " + c.$last;
Declaration expressions
int.TryParse(s, out var x);
Await in catch/finally
try … catch { await … } finally { await … }
Maybe
Exception filters
catch(E e) if (e.Count > 5) { … }
Typecase
Select Case o : Case s As String : …
Guarded cases
Select Case i : Case Is > 0 When i Mod 2 = 0
Partial modules
Partial Module M1
N/A
Partial interfaces
Partial Interface I1
Multiline string literals
"HelloWorld"
Year-first date literals
Dim d = #2014-04-03#
Binary literals
0b00000100
Digit separators
0xEF_FF_00_A0
Line continuation comments
Dim addrs = From c in Customers ' comment
TypeOf IsNot
If TypeOf x IsNot Customer Then …
Expression-bodied members
public double Dist => Sqrt(X * X + Y * Y);
Event initializers
new Customer { Notify += MyHandler };
Null propagation
customer?.Orders?[5]?.$price
Planned
Semicolon operator
(var x = Foo(); Write(x); x * x)
Private protected
private protected string GetId() { … }
Params IEnumerable
int Avg(params IEnumerable numbers) { … }
Constructor Inference
new Tuple(3, "three", true);
String interpolation
"\{p.First} \{p.Last} is \{p.Age} years old."
TryCast for nullable
Dim x = TryCast(u, Integer?)
Delegate combination with +
d1 += d2
Implicit implementation
Class C : Implicitly Implements I
nameof operator
string s = nameof(Console.Write);
Strict modules
Strict Module M
Faster CInt
Dim x = CInt(Math.Truncate(d)) |
#pragma
#Disable Warning BC40008
Checked and Unchecked blocks
Checked : x += 1 : End Checked
Field targets on autoprops
Serializable> Property p As Integer
If(b,e1,e2) uses type context
Dim x As Integer? = If(b,1,Nothing)
Windows 8.1, a free upgrade for Windows 8 users, has features to make it more familiar to users of previous versions of Windows plus new features and functionality.
The Windows 8.1 update was released last Thursday, October 17, 2013.
It is a free download available from the Windows Store.
Microsoft Application Insights is a suite of services which helps delivery teams know if their application is available, performing, and giving users features users want.
Application Insights works with services built into the Microsoft .NET Framework, Java, Microsoft Azure services, Web sites, Windows Store applications and Windows Phone 8 applications.
With complete end-to-end monitoring, you can get a true 360-degree picture of your application, not just small pieces of isolated data.
More...
Visual Studio 2013 is new and improved.
Visual Studio 2013 provides support for Windows 8.1 App development.
It includes features to make it easier to develop across all Visual Studio languages and platforms: tools, controls and templates, new Coded UI test support for XAML apps, UI Responsiveness Analyzer and Energy Consumption profiler for XAML & HTML apps, enhanced memory profiling tools for HTML apps, and improved integration with the Windows Store.
Blend for XAML has been enhanced with significant new capabilities for Windows Store app design. Blend includes the addition of rulers and custom guides for more precise content layout as well as improved styling capabilities. Blend for HTML also inherits these enhancements and adds specific new capabilities for building Windows Store apps with HTML, such as the new timeline for animating changes in CSS.
Visual Studio 2013’s One ASP.Net unifies your web project experience so that you can create ASP.NET web applications using your preference of ASP.NET component frameworks in a single project. This new unified experience includes the ability to easily create hybrid applications that include improved versions of ASP.NET WebForms, MVC or Web API, all in a single project. Now you can mix and match the right tools for the job within your web projects, giving you increased flexibility and productivity when developing for the web.
‘Browser Link’ syncs HTML and CSS changes in Visual Studio with one or more open browsers‘Browser Link’ allows you to connect Visual Studio 2012 to one or more open browsers.
public static class ExtNumbers
{
public static decimal ToDecimal(this string value)
decimal result = Con.D0000m;
if (String.IsNullOrEmpty(value))
return result;
}
decimal.TryParse(value, out result);
Scaffolding
With this update, scaffolding will correctly detect what are the versions of NuGet packages that the project is using. For example, if the project is still using ASP.NET MVC 5.1.2, then scaffolding will use 5.1.2, instead of 5.2.
JSON Editor
Auto formatting is now part of the JSON editor and is turned on by default.
Brace and brackets match highlighting are just like in C# and JavaScript editors now.
Supports more selector patterns
Drag and Drop Magic
Added drag-and-drop of fonts, images and.css files from solution explorer into .css files.
Added support for two-factor authentication in One ASP.NET templates for MVC and Web Forms.
There's more...
Below is a class and enum that together provide a flexible way to return an action result to a caller.
It can be used to return error or success results.
It contains multiple constructors that give the flexibility of instantiating the ActionResult object in the context of the called method and possible actions that will take place.
Instantiate before making a call to pass it into a method call or instantiate within a method.
namespace aZSoftware { public enum ActionResultEnum { Unknown = 0, Success = 1, Failure = 2 } public class ActionResult { public ActionResultEnum ActionResultEnum { get; set; } public string Message { get; set; } public object ResultObject { get; set; } public string ErrorLog { get; set; } public ActionResult(ActionResultEnum actionResult) { this.ActionResultEnum = actionResult; Message = string.Empty; ResultObject = null; ErrorLog = string.Empty; } public ActionResult(ActionResultEnum actionResult,string message) { this.ActionResultEnum = actionResult; Message = message; ResultObject = null; ErrorLog = string.Empty; } public ActionResult(ActionResultEnum actionResult, string message,object resultObject) { this.ActionResultEnum = actionResult; Message = message; ResultObject = resultObject; ErrorLog = string.Empty; } public ActionResult(ActionResultEnum actionResult, string message, object resultObject,string errorLog) { this.ActionResultEnum = actionResult; Message = message; ResultObject = resultObject; ErrorLog = errorLog; } } }