Insert from form into multiple entities


I want to store data into multiple entities via a form.

But I have the problem that in the Company database only the CompanyAddress Identifier is stored. The assignment for CompanyType and CompanyDetail does not work and I don't really understand why? Where do I have my thinking error?




Hi Benjamin,

At least, in your comments, you are setting the Input Parameters' Id and not the respective IDs from CompanyRecord, as you are doing with the Address.

You need to set CompanyRecord.CompanyDetailId and not CompanyDetailRecord.Id.
In the same way, you need to set CompanyRecord.CompanyTypeId and not CompanyTypeRecord.Id.

Probably, the way it is, those values are empty and that is your problem. 

Hope it helps.

Best regards.

Hi, what can I say now...

When experience is lacking, you simply don't see these little things. 

Thanks for the tip.

Another question for this case:

In this case, does it make a difference which type of assignment I choose? 

As you have just one Entity in your Aggregate, there is no difference in the way you might choose. Both Current or Current.Entity will work fine.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.