Note that there are some explanatory texts on larger screens.

plurals
  1. POSystem.InvalidOperationException error MVC3 ASP.net
    text
    copied!<p>Can someone Help me in this error Im searching on how to solve this problem but i can make it clear if i post the error and my codes here</p> <pre><code>&gt; Server Error in '/' Application. The entity type APPLICANT is not part of the model for the current context. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: The entity type APPLICANT is not part of the model for the current context. Source Error: Line 19: public IEnumerable&lt;APPLICANT&gt; GetApplicant() Line 20: { Line 21: return context.APPLICANTs.ToList(); Line 22: } Line 23: Stack Trace: [InvalidOperationException: The entity type APPLICANT is not part of the model for the current context.] System.Data.Entity.Internal.InternalContext.UpdateEntitySetMappingsForType(Type entityType) +209 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +51 System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +164 System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator() +38 System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable&lt;TResult&gt;.GetEnumerator() +99 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +369 System.Linq.Enumerable.ToList(IEnumerable`1 source) +58 _2ndApplicants.DAL.ApplicantRepository.GetApplicant() in C:\Users\Documents\Visual Studio 2010\2ndApplicant\2ndApplicant\DAL\ApplicantRepository.cs:21 _2ndApplicant.Controllers.ApplicantController.Index(String currentFilter, String searchString, Nullable`1 page) in C:\Users\Documents\Visual Studio 2010\2ndApplicant\2ndApplicant\Controllers\ApplicantController.cs:49 lambda_method(Closure , ControllerBase , Object[] ) +295 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +214 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27 System.Web.Mvc.&lt;&gt;c__DisplayClass15.&lt;InvokeActionMethodWithFilters&gt;b__12() +55 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +253 System.Web.Mvc.&lt;&gt;c__DisplayClass17.&lt;InvokeActionMethodWithFilters&gt;b__14() +21 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324 System.Web.Mvc.Controller.ExecuteCore() +106 System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +91 System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10 System.Web.Mvc.&lt;&gt;c__DisplayClassb.&lt;BeginProcessRequest&gt;b__5() +34 System.Web.Mvc.Async.&lt;&gt;c__DisplayClass1.&lt;MakeVoidDelegate&gt;b__0() +19 System.Web.Mvc.Async.&lt;&gt;c__DisplayClass8`1.&lt;BeginSynchronous&gt;b__7(IAsyncResult _) +10 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62 System.Web.Mvc.&lt;&gt;c__DisplayClasse.&lt;EndProcessRequest&gt;b__d() +48 System.Web.Mvc.SecurityUtil.&lt;GetCallInAppTrustThunk&gt;b__0(Action f) +7 System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629296 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18034 </code></pre> <p>IN THIS LINE </p> <pre><code>public class ApplicantRepository : IApplicantRepository, IDi </code></pre> <p>sposable { private Entities context;</p> <pre><code> public ApplicantRepository(Entities context) { this.context = context; } public IEnumerable&lt;APPLICANT&gt; GetApplicant() { return context.APPLICANTs.ToList(); &lt;--------- Where i Triggered the Error } public APPLICANT GetApplicantByID(int id) { return context.APPLICANTs.Find(id); } </code></pre> <p>Im search on how can i solve this Someone who can help is appreciated :) Thanks :3</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload