Monday, 12 August 2013

Linq update with an Ilist in C#

Linq update with an Ilist in C#

I would like to update my database datas and I have the following 2
"lists" of element :
Linq Query returning me an IQueryable<VM_CategoryLabel> from the database
(that has to be updated)
IList<VM_CategoryLabelExtra> (list coming from a web interface)
Here are my 2 classes:
public class VM_CategoryLabel
{
public int Id { get; set; }
public int Order { get; set; }
public string Label { get; set; }
public string Unit { get; set; }
public bool Checked { get; set; }
}
public class VM_CategoryLabelExtra
{
public int Id { get; set; }
public int IdCat { get; set; }
public int Order { get; set; }
public string Label { get; set; }
public string Unit { get; set; }
public bool Checked { get; set; }
}
It seems so basic, but I get an error and was unsuccessful trying with
Linq to join or with the let. Maybe the way I am doing it is totally wrong
?

No comments:

Post a Comment