I have 3 tables (Master, Imagen, Linea) were:
Master
public virtual int Id { get; private set; }
public virtual Imagen imagen { get; set; }
Imagen
public virtual int Id { get; private set; }
public virtual Linea linea { get; set; }
Linea
public virtual int Id { get; private set; }
public virtual String Nombre { get; set; }
I need a query like this:
SELECT * FROM dbo.Master
INNER JOIN dbo.Imagen ON dbo.Master.imagen_id = dbo.Imagen.Id
INNER JOIN dbo.Linea ON dbo.Imagen.linea_id = dbo.Linea.Id
WHERE dbo.Linea_Id = 5
But I dont know how to tell Fluent Nhibernate to create this query using the automapper. So far I've tried this:
ICriteria c = session.CreateCriteria(typeof(Master))
.CreateAlias("dbo.Imagen", "img", JoinType.InnerJoin)
.Add(Restrictions.Eq("img.linea_id", id_linea));
return c.List<Master>();
But I get this error: could not resolve property: dbo of: ImageManager.Model.Entity.Master
Any ideas on how to do a Inner Join? Thanks in advance