Posts

Showing posts from 2017

C# 7 Features

Image
In this blog post we will discuss about the Local functions/methods, Ref returns and locals, Expression bodied members,Throw Exception from Expression Local Methods/Functions Now we can define local functions inside another.Ya, That's right, C# 7 version provides the ability to call a function which is defined inside another function. static void Main(string[] args) { int localvar = 50; //local function defined inside main method int LocalFunction(int a) { return localvar * a; } Console.WriteLine(LocalFunction(50)); } If we observe the code above, local function with the name "LocalFunction" is defined inside the main method and called by main method itself. This is how we can define a local function to perform a specific operation and return value to the enclosed functio

Features in C# 7 - Pattern matching

Image
Hello Readers, In This blog post I have explained about two new features introduced with C# 7.0. (Along with other features like Tuples,local functions,ref return and ref local,throw expression, Deconstruction,Literal improvements,Generalized Async return types,More expression bodied members).   Pattern Matching   Out variable ( with enhancement)  Pattern Matching Patterns are already exists in the programming world.But C# has introduced for the first time in it's latest version 7.0( as of VS 2017). C# 7.0 version allows us to use a pattern in existing "is" statement and with "switch" statement and allows us to compare whether value has certain type or not. We can m

C# 7 Features - Tuples

Image
In this blog post we are going to see the new feature called Tuple type introduced with C# 7.0 Version by Microsoft. “C# 7.0 adds a number of new features and brings a focus on data  consumption, code simplification and performance. Perhaps the biggest  features are tuples, which make it easy to have multiple results, and pattern  matching, which simplifies code that is conditional on the shape of data. But  there are many other features big and small. We hope that they all combine to  make your code more efficient and clear, and you more happy and  productive,” Mads Torgersen, program manager at Microsoft, wrote in a  post .

How to add your .net application to git hub repository

Image
In this blog post I have listed out the steps to be followed while adding your .net application to git hub repository from visual studio IDE.I have listed out the steps using Visual Studio 2012 version. Steps  for later visual studio versions may differ.  Open your .net application in Visual Studio 2012 or in any of later versions. 1) Go to File Menu then click on Add to Source Control. 2) Select the Git radio button(Microsoft Git Provider) from the popup.Click Ok. That will create a local repository. 3) Go to https://github.com/   GitHub website. Login or Register an account.I have a free package selected on my account. 4) Let's start Creating a new repository without selecting the option "Initialize this repository with a README".   Above step will  create an empty repository with no Master branch. Go back to Visual Studio IDE Ensure that we have the Microsoft Git Provider selected under Tools then Option