I am new to the world of EF. Made a connection to the database on the principle of Database First. I need to find all occurrences of "ul" in the field of the School. Address and replace with "st." I kind of did it:
var context = new SchoolEntities(); foreach (var school in context.Школы) { school.Адрес = school.Адрес.Replace("ул ", "ул."); } context.SaveChanges(); But this error appears:
Исключение типа "System.Data.Entity.Infrastructure.DbUpdateException" возникло в EntityFramework.dll, но не было обработано в коде пользователя Дополнительные сведения: Unable to update the EntitySet 'Школы' because it has a DefiningQuery and no <UpdateFunction> element exists in the <ModificationFunctionMapping> element to support the current operation.
school.Адресis a string? Strings in C # are immutable. - VladD