Click here to Skip to main content
15,894,180 members
Articles / Programming Languages / C#

Safely Calling Virtual Members From Constructors...

Rate me:
Please Sign up or sign in to vote.
2.86/5 (5 votes)
23 Mar 2015CPOL1 min read 18K   33   5  
Many programmers know what calling virtual members from not sealed class constructor may cause runtime error, because some members used in virtuals could be not initialized. I will show a simple way to call virtuals safely from constructors of inherited classes.

Views

Daily Counts

Downloads

Weekly Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Saber Interactive
Russian Federation Russian Federation
My specializations:

C# (especially multithreading)
WPF (MVVM, styling)
WCF (message inspectors, configuration)
MSSQL (administartion, creation, procedures, recursive queries, bulk processing)

Comments and Discussions