What’s New in C# 5.0 - Learn about CallerMemberName Attribute - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Monday, July 23, 2012

What’s New in C# 5.0 - Learn about CallerMemberName Attribute

C# 5.0 comes with Visual Studio 2012 and .NET Framework 4.5. Currently it is in RC (Release Candidate) mode and will get the final RTM version soon. In our last CSharp blog post "Evolution of C# (1.0 – 5.0)", we learned about the evolution of C# and also we also came to know about the main features introduced in each C# version.   Today in this post, we will learn about one new attribute that has been introduced in C# 5.0 named "CallerMemberName" for developers. Yes, it is for developers to trace the information about the caller code. Let's begin discussing about it.   What is CallerMemberName in C# 5.0? [CallerMemberName] is an attribute introduced in C# 5.0, which allows you to obtain the method or property name of the caller to the method. You can find this attribute named "CallerMemberNameAttribute" under the namespace System.Runtime.CompilerServices.   You can use the [CallerMemberName] attribute to avoid specifying the member name as a String...

Read More...

I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

C#,.NET,Architect,Intermediate,,Visual Studio,Visual Studio 2012, C# 5.0

No comments:

Post a Comment