Silverlight -RIA Services-This EntitySet of type <> does not support the 'Add' operation.
Posted
by user289082
on Stack Overflow
See other posts from Stack Overflow
or by user289082
Published on 2010-03-10T16:06:30Z
Indexed on
2010/05/18
21:40 UTC
Read the original article
Hit count: 1625
In Silverlight project I have this exception when I tried to Add a new object to a DataGrid when a button is clicked. In the DomainService class.. I know I have to implement the Add operation for the new Entity I'm putting, but how can I do that? I mean I did the class, the get method but how do I do the insert operation, I can't see my class in this.ObjectContext, so to whom I would be adding this new object, I have the next fragments of code:
public partial class SisPer
{
[Key]
public int Id { get; set; }
public string Nombre_Sistema { get; set; }
public string Nombre_Perfil { get; set; }
public string Nivel { get; set; }
public bool Estatus { get; set; }
}
public IQueryable<SisPer> Get_SisPer()
{
var query =
from per in this.ObjectContext.Cat_Perfil
join sis in this.ObjectContext.Cat_Sistema
on per.Cat_Sistema.Id equals sis.Id
select new SisPer()
{
Id = per.Id,
Nombre_Sistema = sis.Nombre,
Nombre_Perfil = per.Nombre,
Nivel = per.Nivel,
Estatus = per.Estatus
};
return query;
}
public void InsertSisPer(SisPer sisper)
{
?? I can't see this.ObjectContext.AddToSisPer();
}
Plz Help!!
© Stack Overflow or respective owner