Adding Objects to subclass based on properties?

Hi guys, im wondering if an object can be part of both a class and a subclass? And if so, how do i add these objects to the subclass based on one of their properties? Sorry i am very new to c# and coding.

I have a class ‘Client’ that have the following properties:

public class Client { public Client() { } public String FirstName { get; set; } public String LastName { get; set; } public String DateOfBirth { get; set; } public int Id { get; set; } public decimal Balance { get; set; } public String Status { get; set; } //either VIP or non-VIP 

I have now created a sublcass:

class VipClient : Client { } 

How would i go about having the objects with a Status value of VIP becoming part of this subclass but also remaining part of the ‘Client’ class? Long story short, all objects belong to the ‘Client’ class but only some to the ‘VIPClient’ class.

Thank you and apologies for the noob question.

submitted by /u/TanioraNZ
[link] [comments]

Leave a Reply