i have one class with two inheritance interfaces and yours attributes are explicits because both have some equals attributes, so, i need use LINQ with this class, but i can't access the explicits attributes when i use "select new Foo" ... look the case:
public class QuestaoMontaProva : IQuestao, IExercicio
{
public int Discordo { get; set; }
public int Rever { get; set; }
public int Anotacao { get; set; }
public int Realizada { set; get; }
public int Ativo { set; get; }
int IQuestao.Id { get; set; }
string IQuestao.EnunciadoQuestao { get; set; }
string IQuestao.ExercicioTipo { get; set; }
....
and my LINQ :
var flags = (from b in dt.AsEnumerable()
select new QuestaoMontaProva
{
IdQuestao = Convert.ToInt32(b["ID_QUESTAO"]), // i can't access this
IdTipoExercicio = Convert.ToInt32(b["ID_TIPOEXERCICIO"]),// i can't access this
Discordo = Convert.ToInt32(b["DISCORDO"]),
Rever = Convert.ToInt32(b["REVER"]),
Anotacao = Convert.ToInt32(b["ANOTACAO"]),
Realizada = Convert.ToInt32(b["REALIZADA"]),
Correta = Convert.ToInt32(b["CORRETA"]),
Ativo = Convert.ToInt32(b["ATIVO"])
}).ToList();
i found one way, i just create one proxy to use the attributes of the interfaces in my class, look:
public class QuestaoMontaProva : IQuestao, IExercicio {
... }
this solved my problem!!! i hope it helps all...