Query InnerJoin Xamarin Android with Sqlite net pcl

0

I have a query in sqlite where I do several inner join

    var query1 = db.Query<Color>("select ar.Estilo, co.Nombre as Color, ac.Nombre as Acabado, ma.Nombre as Marca,te.Nombre as Otoño, su.Nombre as SubLinea from  Articulo as ar inner join Acabado as ac on ar.IdAcabado = ac.IdAcabado inner join Clasificacion as cl on ar.IdClasificacion = cl.IdClasificacion inner join Color as co on ar.IdColor = co.IdColor inner join Marca as ma on ar.IdMarca = ma.IdMarca inner join Sublinea as su on ar.IdSublinea = su.IdSublinea inner join Temporada as te on ar.IdTemporada = te.IdTemporada").ToList();

But the method, db.Query < > () asks me as a parameter for the Object type. I need to be able to use a generic type of object, because the query brings me fields of different types of objects, and since it is of the 'Color' type that I currently use, it only brings me the result of that table.

 var query1 = db.Query<Color> 

Do I need to change the Color Object to some kind of Generic object so that the query brings me everything, any ideas?

    
asked by Oscar Navarro 16.08.2017 в 00:24
source

1 answer

1

The color object must be an entity that contains as properties the other entities that you are trying to map in such a way that the query returns the color objects that match the query and in its properties it brings the other entities

    
answered by 16.08.2017 / 01:08
source