//Delete Last Record which has income
var itemToRemove = db.People.LastOrDefault(p => p.Incomes.Any());
db.Incomes.RemoveRange(itemToRemove.Incomes);
db.People.Remove(itemToRemove);
it gives me this error
An unhandled exception of type 'System.NotSupportedException' occurred in EntityFramework.SqlServer.dll
Additional information: LINQ to Entities does not recognize the method 'EF_Examples_02.Person LastOrDefault[Person]
I have two Tables(Person,Income) each person can have n incomes . two Tables have relationship.