1. Named parameters - you can pass parameter to any function with name in any sequence.
Ex. Private void Shape(string Name, int Height, int Width)
you can call the function like
Shape(Height : 10, Name : "Rectangle", Width : 20)
2. Optional parameters - You just need to assign value to parameter at definition, then at the time of calling that parameter will be optional.
Ex. Private void Shape(string Name, int Height, int Width = 50)
you can call the function like
Shape(Height : 10, Name : "Rectangle")
3. Dynamic keyword - It represent an object and it's operations resolved at run time.
Ex. private void Shape(dynamic A)
{
A.CircleShap();
}
You can pass any type of object here that have a function CircleShap().
4. Co-Varience and Contravariance - If you create a delegate and assign a method to delegate then it required that signature of method and delegate should be match. Co-Varience and Contravariance changes this need little bit.
Covariance - It allows a more derived return type method to be assign than delegate’s return type.
Contravariance - it allows less derived parameters type method to be assign than delegate’s parameter’s type.
5. Generate from usage - If you write code for usage of any object then you can generate the object by right clicking and clicking on generate.
Ex.
[TestMethod]
public void TransferFundsTest()
{
Account source = new Account() {Balance = 300.0};
Account destination = new Account() {Balance = 100.0};
var xferService = new XferService();
xferService.Transfer(source, destination, 50.0);
Assert.AreEqual(250, source.Balance);
Assert.AreEqual(150, destination.Balance);
}
Right-click on the one of the "Account" instances and select "Generate" and then "Class". Visual Studio generates a simple Account class with no members. Now right-click on one of the "Balance" references and select "Generate" and then "Property". Our Account class now has a simple get/set Balance field. Repeat these same steps with XferService and the Transfer method. Without too much work, we’ve got the following code generated from our unit tests:
class Account
{
public double Balance { get; set; }
}
class XferService
{
internal void Transfer(Account source, Account destination, double p)
{
throw new NotImplementedException();
}
}
6. Reference highlighting - If you select any word in IDE window all same words in window become selected. Now you can navigate to those selected words by clicking ctrl+shift+down arrow and ctrl+shift+ up arrow.
Ex. Private void Shape(string Name, int Height, int Width)
you can call the function like
Shape(Height : 10, Name : "Rectangle", Width : 20)
2. Optional parameters - You just need to assign value to parameter at definition, then at the time of calling that parameter will be optional.
Ex. Private void Shape(string Name, int Height, int Width = 50)
you can call the function like
Shape(Height : 10, Name : "Rectangle")
3. Dynamic keyword - It represent an object and it's operations resolved at run time.
Ex. private void Shape(dynamic A)
{
A.CircleShap();
}
You can pass any type of object here that have a function CircleShap().
4. Co-Varience and Contravariance - If you create a delegate and assign a method to delegate then it required that signature of method and delegate should be match. Co-Varience and Contravariance changes this need little bit.
Covariance - It allows a more derived return type method to be assign than delegate’s return type.
Contravariance - it allows less derived parameters type method to be assign than delegate’s parameter’s type.
5. Generate from usage - If you write code for usage of any object then you can generate the object by right clicking and clicking on generate.
Ex.
[TestMethod]
public void TransferFundsTest()
{
Account source = new Account() {Balance = 300.0};
Account destination = new Account() {Balance = 100.0};
var xferService = new XferService();
xferService.Transfer(source, destination, 50.0);
Assert.AreEqual(250, source.Balance);
Assert.AreEqual(150, destination.Balance);
}
Right-click on the one of the "Account" instances and select "Generate" and then "Class". Visual Studio generates a simple Account class with no members. Now right-click on one of the "Balance" references and select "Generate" and then "Property". Our Account class now has a simple get/set Balance field. Repeat these same steps with XferService and the Transfer method. Without too much work, we’ve got the following code generated from our unit tests:
class Account
{
public double Balance { get; set; }
}
class XferService
{
internal void Transfer(Account source, Account destination, double p)
{
throw new NotImplementedException();
}
}
6. Reference highlighting - If you select any word in IDE window all same words in window become selected. Now you can navigate to those selected words by clicking ctrl+shift+down arrow and ctrl+shift+ up arrow.







