Problem with update master detail entity
See original GitHub issueHi, I have a problem with an update in a master-detail entity, master is News and detail is ContentRelations. and I user CRUDAsyuncService and Update method and pass it master entity. this is my code:
public class News : Content
{
public string Description { get; set; }
public string Body { get; set; }
public DateTime PublishDate { get; set; }
public bool IsPromoted { get; set; }
public DateTime? PromotionExpireDate { get; set; }
}
public abstract class Content : FullAuditedEntity<int, User>, IPassivable, INeedCrudPermissions
{
public string Title { get; set; }
public bool IsActive { get; set; }
public virtual ContentProtection ContentProtection { get; set; }
public virtual ICollection<ContentRelation> ContentRelations { get; set; } = new
List<ContentRelation>();
}
I got this error:
e.InnerException {System.Data.SqlClient.SqlException (0x80131904): Cannot insert explicit value for identity column in table ‘ContentRelations’ when IDENTITY_INSERT is set to OFF.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
How to update master detail in Entity Framework using ...
The problem is : the master is updated,new details is added,. but the updated detail not persistence.
Read more >Refresh a master/detail form when an insert/update occurs
I use Oracle ADF with Jdeveloper 10.1.3.4 and EJBs for my datacontrol. I have two entities which have a master/ detail relationship...
Read more >Power Tools Master - Detail problems #11379
This entity is working fine (it just has a few String properties). Next, I created a Master/Details entity named "SalesRegion". The intention is ......
Read more >Error when dragging the details table, en Master / detail
I make a new project windows Forms (.Net Fframework). I add a new element: ADO.Net Entity Data Model, database Northwind.
Read more >Advance Master Detail CRUD in MVC ASP.NET CORE 6 ...
In Here , I have used advanced features of Entity framework core and ... type of master detail screens like Salesinvoice, Purchase order, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mehdih66 If you want to update entities and child entities within a single method.
Fake code:
Ok thanks