Define Class RequestObject As Session SessionID = "" MemberID = "" LoginName = "" Enddefine Define Class MemberCC As Session CCName = "" CCNumber = "" CCExpiry = "" CCType = "" EndDefineAt runtime I can do this:
AddProperty(RequestObject,"oCreditCard") This.oCreditCard = Createobject("MemberCC")to get a Complex Class:
RequestObject SessionID = "" MemberID = "" LoginName oCreditCard CCName CCNumber CCExpiry CCTypeThis is very easy to do at the VFP end.
[Serializable] public class RequestObject { public string SessionID = ""; public string MemberID = ""; public string LoginName = ""; }2. If I have the above class and another class as below :
[Serializable] public class csBankDetails { public string csAcctname = ""; public string csBankacct = ""; public string csBankName = ""; public string csBanksid = ""; public string csBranchName = ""; }and at runtime I instantiate the RequestObject class and want to add the csBankDetails class to it to create a complex object like below, how can I do that in C# at runtime to get a complex class as below?
SessionID MemberID LoginName csBankDetails csAcctname csBankacct csBankName csBanksid csBranchNameThe complete logic for my application is in VFP and it would take too long and too much maintenance to convert the logic to C#.