More CSharp Language Changes and Updates
Transcript of More CSharp Language Changes and Updates
-
7/30/2019 More CSharp Language Changes and Updates
1/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
More C# Language Changes and
Updates
http://www.LearnNowOnline.com
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
2/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Implementing New Language Features
Demo
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
3/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Named and Optional Parameters
Named parameters let you specify method
parameters with a name
Can reorder names when calling
Names arent required
Optional parameters arent required
Must be last in signature
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
4/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Caller Information
Attributes for info about calling code
CallerFilePathAttribute
CallerLineNumberAttribute
CallerMemberNameAttribute
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
5/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Covariance and Contravariance
Allow implicit conversion between types
Apply to arrays delegates and generic type
arguments
Covariance: preserves type compatibilitiy
Contravariance reverses type compatibility
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
6/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Embedded Interop Assemblies
Traditional COM References Hold all Metadata
Embedded Interop Assemblies only include the
actual methods used
No need to deploy Primary Interop Assembly
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
7/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
New Command Line Options
The C# compiler has three new options
/link
/langversion
/appconfig
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
8/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Including Common .NETFramework Classes
Demo
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
9/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
New Types of Interest
BigInteger
Complex
Tuple
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
10/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Lazy Initialization
Lazy allows just-in-time initialization
Object not created until first used
Can specify constructor and thread safety
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
11/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
New Generic Types
ReadOnly interfaces for Lists, Collections, and
Dictionarys
New Set types
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
12/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Breaking Changes
Demo
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
13/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Breaking Changes
Lambda Expressions
LINQ Expressions
Named Arguments
Overload Resolution
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
14/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Essential Skills
Demo
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
15/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Debugging Tips
Breakpoints
Shortcut Keys
Ctrl+F10 Step Over
Ctrl+F11 Step Into
Shift+F11 Step Out
Move Cursor
Run To
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
16/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Debugger Windows
Exceptions
Autos
Locals
Watch
Immediate
Call Stack
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
17/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Building Code
Can build both Solutions and Projects
Build only what needs to be built
Rebuild
forces build of all projects Clean removes assemblies from build folder
Build Configurations
http://www.learnnowonline.com/http://www.learnnowonline.com/ -
7/30/2019 More CSharp Language Changes and Updates
18/18
Learn More @ http://www.learnnowonline.comCopyright by Application Developers Training Company
Questions?
http://www.LearnNowOnline.com
http://www.learnnowonline.com/http://www.learnnowonline.com/