what does this asp.net mvc compile time error states?

Posted by Pandiya Chendur on Stack Overflow See other posts from Stack Overflow or by Pandiya Chendur
Published on 2010-05-03T10:10:04Z Indexed on 2010/05/03 10:18 UTC
Read the original article Hit count: 301

Filed under:
|
|
|

I have a repository class and it has this,

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CrMVC.BusinessObjects;

namespace CrMVC.Models
{
    public class ConstructionRepository
    {
        private CRDataContext db = new CRDataContext();

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

        }
    }
 }

And My MaterialsObj class is under CrMVC.BusinessObjects namespace and i using it in my repository class....

namespace CrMVC.BusinessObjects
{
    public class MaterialsObj
    {
         //My logic here
    }
}

But when i compile this i get this error

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\root\19360d4c\3d21e226\App_Web_materials.aspx.7d2669f4.a8f-zsw5.0.cs(148):
error CS0426: The type name 'Materials' does not exist 
 in the type 'CrMVC.Models.ConstructionRepository'

Am i missing something any suggestion....

Edit:

There is no class named Materials in my repository class then why i get this error..

© Stack Overflow or respective owner

Related posts about c#

Related posts about asp.net-mvc