Click here to Skip to main content
15,915,048 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
The type or namespace name 'IRepository' could not be found (are you missing a using directive or an assembly reference?)



what is the namespace for IRepository?
Posted
Comments
[no name] 14-Feb-14 3:25am    
Post the piece of code..It's an Interface..so should not be namespace issue..
vksvpp 14-Feb-14 3:32am    
private readonly IRepository db;

public JsonResult Users(string term)
{
using (CMSEntities CMS = new CMSEntities())
{

var data = db.Query<studentregistration>()
.Where(r => r.Name.StartsWith(term))
.Select(r => new { r.Id, value = r.Name })
.Take(10)
.ToArray();
return Json(data, JsonRequestBehavior.AllowGet);
}
}


I tried this for autocomplete textbox in mvc2.

This appears to be a custom interface. Ensure all your dll references have been properly referenced.
 
Share this answer
 
Comments
vksvpp 14-Feb-14 3:28am    
All dll's are properly referenced.
johannesnestler 14-Feb-14 6:21am    
No, can't be. IRepository is a common Name for a Interface representing the Repository-Pattern. Depending on you context it may be defined in some Framework you are using or by some "common" code in your project. And most likely you are just missing the reference (I would assume you know about "using"...)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900