Quantcast
Channel: Go4Expert
Viewing all articles
Browse latest Browse all 1987

Auto Property In C# 6.O

$
0
0
The auto property came into existence at C# version 3.0. It is used for code simplification and by using this your code becomes more readable


One of the great features of c# is you can declare a property.

Code:
public class Student
    {
        public Guid Id { get; }=Guid.NewGuid();
    }
In this code, you can initialize the property at the time of declaration. By using this feature you don’t have a need to write a constructor and initialize the property in that constructor....

Auto Property In C# 6.O

Viewing all articles
Browse latest Browse all 1987

Trending Articles