Get the value of a field with Linq

0

I want to get the value of the field extension and be able to use it in a variable but it marks me error. This is the code I'm using

var ext = (from ex in ctx.usuarios_bastion where ex.id == idus select ex).ToList().ToString();
            string completeName = idus.ToString()+ext.ToString();
    
asked by Marco Mireles 22.11.2018 в 22:15
source

1 answer

1

If it is a single data, of a single record of the users_bastion table, you have to specify it:

var ext = (from ex in ctx.usuarios_bastion where ex.id == idus select ex).First().NombreDelCampo;
string completeName = idus.ToString()+ext.ToString();
    
answered by 22.11.2018 / 22:55
source