var query1 = from ra in contexto.RADICACIONES
join us in contexto.USUARIOS on ra.ID_USUARIOS_FK equals us.ID_USUARIOS
join usex in contexto.USUARIO_EXTERNO on ra.ID_USUARIO_EXT_FK equals usex.ID_USUARIO_EXT
orderby ra.ID_RADICACION descending
select new {ra.ID_RADICACION, ra.ASUNTO, ra.FECHA, us.NOMBRE, usex.NOMBRE1 };
gvradica.DataSource = query1.ToList();
gvradica.DataBind();
I have this code and I want to alias the names I've tried in the following ways
select new {Id = ra.ID_RADICACION, Asunto = ra.ASUNTO, Fecha = ra.FECHA, Enviado por = us.NOMBRE, Dirigido a = usex.NOMBRE1 };
And I've also tried like this
select new {["Id"] = ra.ID_RADICACION,["Asunto"] = ra.ASUNTO,["Fecha"] = ra.FECHA, ["Enviado por:"] = us.NOMBRE, ["Dirigido a:"] = usex.NOMBRE1 };
And throws the following error
The fields are generated automatically and passed to a GridView, they must be this way, since an important part of the business logic is applied there, so I can not remove the check from self-generated fields