Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# create class from parent class

public class ChildClass : ParentClass
{


    public ChildClass(ParentClass ch)
    {
        foreach (var prop in ch.GetType().GetProperties())
        {
            this.GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(ch, null), null);
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: reverse a linked list C# 
Csharp :: check if two date ranges overlap c# 
Csharp :: c# .net automapper profile 
Csharp :: how to write web service for API in c# 
Csharp :: Remove access to admin from deleting the file in C# 
Csharp :: c# console delete last character 
Csharp :: c# calendar button random dates 
Csharp :: photon2 addcalbacktarget 
Csharp :: run dll file 
Csharp :: decimal operator in Convert.toDouble() C# 
Csharp :: clickable table row asp.net core 
Csharp :: moq set delay to return 
Csharp :: display array elemetns to text box c# 
Csharp :: speech 
Csharp :: C# order a sorted list by key 
Csharp :: c# remove xml invalid characters 
Csharp :: c# integer part of float 
Csharp :: guicontrol text ahk 
Csharp :: sort array dotnet 
Csharp :: drawing default serializedproperty unity 
Csharp :: c# convert string to array 
Csharp :: Get logged in user in ASP.Net 
Csharp :: dictionary.add values to array c# 
Csharp :: generate random light colors programatically in android 
Csharp :: run in wpf 
Csharp :: unity how to check serialized enum 
Csharp :: c# datediff 
Csharp :: maximum sum subarray c# 
Csharp :: get list of months and year between two dates c# 
Csharp :: entity framework id not auto increment 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =