zahrashoja
پنج شنبه 09 شهریور 1391, 12:41 عصر
میخوام با توجه به تعدادی از آی دی های کاربران برای اونها در جدول جدیدی درج انجام بدم.. کد زیر رو نوشتم که خطا داره:
usend2 = (from row in con.User where row.user_of == age & (row.access_level == 2 || row.access_level == 3 || row.access_level == 4) select row).ToList();
foreach (User item in usend2)
{
agencyEntities a = new agencyEntities();
Message2 m2 = new Message2();
m2.m_id = idsend2;
m2.status = false;
m2.r_id = item.user_id;
a.AddToMessage2(m2);
a.SaveChanges();
}
خطا داره که:
Unable to update the EntitySet 'Message2' because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation.
چکار کنم؟؟؟؟
usend2 = (from row in con.User where row.user_of == age & (row.access_level == 2 || row.access_level == 3 || row.access_level == 4) select row).ToList();
foreach (User item in usend2)
{
agencyEntities a = new agencyEntities();
Message2 m2 = new Message2();
m2.m_id = idsend2;
m2.status = false;
m2.r_id = item.user_id;
a.AddToMessage2(m2);
a.SaveChanges();
}
خطا داره که:
Unable to update the EntitySet 'Message2' because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation.
چکار کنم؟؟؟؟