So i'm creating a custom service to create a customer with it's postal and electronic address. Also I need to create contactPerson for that customer (so my contract class has data members related to custTable,ElectronicAddress and postal address fields. In addition to List of ContactPerson as well which is another contract class for the contractPerson) and i want to create postal and electronics address for each contact
So Currently I'm making contract class data members for each field i want to insert in addition to the listContractPerson
Imagine with me when trying to call the service from c#
i need to fill in c# some DirPartyTable fields ,some DirPerson fields , some DirPersonName fields and some custTable fields (Assuming i'm creating a person type)
so for these i might have about 20 data members ( i also need to do in x++ field = request.sth() about 20 times)
now when i create address for this customer i need to fill fields related to logisticsPostalAddress, logisticsLocation and electronicAddress (also maybe another 20 data members)
But now when i create contactPerson, ( as i said i made a new contract class for this one) let's say i want to create two contact Persons for that customer, so when i create address for each one, then i need to duplicate the data. I mean in c# i need to insert data for ContactPerson1 and ContactPerson2 (maybe there is 10 fields for each one) and in x++ it will be a while loop.
is that normal? I'm feeling like maybe there can be a simpler way? I read that entities can be used but i didn't get it, i mean instead of writing field = request.sth(), what will i write? is there anything that can make things simplified?