Hi,
I have been searching on the forum, and although it is probably there, I couldn't find the solution to this problem:
I have a page where i create a project. On this project I am adding related data. For example: Budget:
This Buget contains ProjectID, Year, Amount.
So the Project has a collection called Budgets. Now I create a new project and would like to populate the Budgets EntityCollection.
ProjectEntity currentProject = new ProjectEntity();
BudgetEntity budget = new BudgetEntity();
budget.Year = Convert.ToInt32(ddlYear.SelectedValue);
budget.Amount = Convert.ToInt32(txtAmount.Text);
currentProject.Budgets.Add(budget);
Problem is that currentProject.Budgets is null ... and I can't do, because it's readonly:
currentProject.Budgets = new EntityCollectino<Budgetentity>();
But I don't want to save the project and later add the budgets ... this should be done in one transaction ...
Can someone helpe me with this?
Tnx in advance!