با سلام خدمت استاد
هنگام آپدیت گروه در جدول Group که با جدول Customer هم در ارتباط هست با ارور Additional information: Attaching an entity of type 'PhoneBook.DataLayer.Gorup' failed because another entity of the same type already has the same primary key value. This can happen when using the 'Attach' method or setting the state of an entity to 'Unchanged' or 'Modified' if any entities in the graph have conflicting key values. This may be because some entities are new and have not yet received database-generated key values. In this case use the 'Add' method or the 'Added' entity state to track the graph and then set the state of non-new entities to 'Unchanged' or 'Modified' as appropriate. مواجه میشم، سرچ کردم ولی به جوابی نرسیدم.. در صورتیکه جدول Customr آپدیت میشه، تصویر ارور رو ضمیمه کردم.. ممنون از شما
با سلام
برای بروزرسانی اطلاعات از دستور زیر استفاده کنین :
db.Entry(payment).State = EntityState.Modified; db.SaveChanges();
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)