Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: EF5 + How to save an entity with its child entities at the same time to the database?

$
0
0

Hi,
Thank you @Arthur and @sarshogh_eng,

Sorry for the late.

I just solved my problem by doing a simple change in my code.

I mentioned in my question that I'm using a ObservableCollection<PurchaseDetail> PurchaseDetails object for creating a PurchaseDetails object collection that the user added to the grid. There was the error; when creating a PurchaseDetails object, I also added the Item object to that. My plan is to display the Item Name in the grid (Because the PurchaseDetails object doesn't have the ItemName property.) It was the error. When I stoped adding that Item , the SaveChanges() worked nicely.

But then I got another issue. Now the Item Name cannot be displayed in the grid.

Is there any wrong implementation that I did? Please help me.


Viewing all articles
Browse latest Browse all 1793

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>