database view
CREATE view [dbo].[VsEFS] with schemabinding as
(
select EfId ,EfAMaxMarks,EfCent,EfRollNo ,A.FsAdded ,A.FsMarks ,A.FsEfId,A.FsEsId
from [dbo].ExamForms ,[dbo].FormSub A
where EfId=FsEfId
)
GO
CREATE UNIQUE CLUSTERED INDEX [IX_O] ON [dbo].[VsEFS]
(
[EfId] ASC,
[FsEsId] ASC
)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
In Controller I have written a code to update value of FsAdded :
IEnumerable<VsEF> vs = db.VsEFS.Where(c => c.EfId == 16714);
foreach (var t in vs)
{
if (t.FsEsId==5491)
t.FsAdded = "45";
}
db.SaveChanges();
but while updating values in database it gives an error like:
The property 'FsAdded' is part of the object's key information and cannot be modified.
database views are updatable from model?
any one can help?