Is this Where condition in Linq-to-sql join correct?

Posted by Pandiya Chendur on Stack Overflow See other posts from Stack Overflow or by Pandiya Chendur
Published on 2010-05-01T07:16:22Z Indexed on 2010/05/01 7:27 UTC
Read the original article Hit count: 299

I have the following Iqueryable method to show details of a singl material,

public IQueryable<Materials> GetMaterial(int id)
{
    return from m in db.Materials
           join Mt in db.MeasurementTypes on m.MeasurementTypeId equals Mt.Id
           where m.Mat_id equals id
            select new Materials()
            {
              Id = Convert.ToInt64(m.Mat_id),
              Mat_Name = m.Mat_Name,
              Mes_Name = Mt.Name,
            };
}

Any suggestion....

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about linq-to-sql