Although this sounds irrational but it works
DerivedClass B = new DerivedClass();
BaseClass bc = JsonConvert.DeserializeObject<BaseClass>(JsonConvert.SerializeObject(B));
More Related Contents:
- How to create List of open generic type of class?
- How do I instantiate a class given its string name?
- Why doesn’t ‘ref’ and ‘out’ support polymorphism?
- How to call base.base.method()?
- What is Shadowing?
- C# : Is Variance (Covariance / Contravariance) another word for Polymorphism?
- When to use enums, and when to replace them with a class with static members?
- How to do generic polymorphism on open types in C#?
- Practical advantage of generics vs interfaces
- Best way to switch behavior based on type [duplicate]
- Why does this polymorphic C# code print what it does?
- Force base method call
- Calling an overridden method from a parent class ctor
- How To Access Two Databases in a Single connection String in C#?
- Prevent Caching in ASP.NET MVC for specific actions using an attribute
- Loop through Textboxes
- Are C# uninitialized variables dangerous?
- How to serialize/deserialize to `Dictionary` from custom XML not using XElement?
- How to add an attribute to a property at runtime
- how to update a table using oledb parameters?
- How do I replace all the spaces with %20 in C#?
- Programmatically adding Images to RTF Document
- Comparison of XSD Code Generators [closed]
- Limit the number of parallel threads in C#
- Embedding a File Explorer instance in a Windows Forms application form
- Cannot load Counter Name data because an invalid index -Exception
- .Net (dotNet) wrappers for OpenCV? [closed]
- Case-INsensitive Dictionary with string key-type in C#
- C# Regex.Split: Removing empty results
- FileResult with MemoryStream gives empty result .. what’s the problem?