Note that there are some explanatory texts on larger screens.

plurals
  1. POHaving problems with Asp.net MVC Unleashed Generic Repostitory
    text
    copied!<p>I just got this book</p> <p>In it there is a .dll for a generic repository. I followed what he did but I always get a error.</p> <pre><code>System.InvalidOperationException was caught Message="The EntitySet name 'MyEntities.CarSet' could not be found." Source="System.Data.Entity" StackTrace: at System.Data.Objects.ObjectContext.GetEntitySet(String entitySetName, String entityContainerName) at System.Data.Objects.ObjectContext.GetEntitySetFromName(String entitySetName) at System.Data.Objects.ObjectContext.AddObject(String entitySetName, Object entity) at GenericRepository.EFGenericRepository.Create[T](T entityToCreate) at CarSite.com.Controllers.RController.Institutions(FormCollection regForm) in I:\p\trunk\Current Site\Controllers\RController.cs:line 227 InnerException: </code></pre> <p>I have no idea why I am getting this. I can't see into the .dll so I don't know what is going on there.</p> <p>My other repositories I wrote work fine. It's just his generic repository.</p> <p>I think I have everything he has expect he has a typed view and the database stuff he needs comes through the parameter as a class.</p> <p>Mine is in a form that I make like this</p> <pre><code> Car send = new Car(); send.Name= regForm["Name"]; send.CarID= regForm["ID"]; Authenticate.repository.Create&lt;Car&gt;(send); </code></pre> <p>I just can't see this effecting it?</p> <p>Edit</p> <p>Now I get this error</p> <pre><code>Entities in 'Entities.CarSet' participate in the 'FK_Car_aspnet_Users' relationship. 0 related 'aspnet_Users' were found. 1 'aspnet_Users' is expected. </code></pre> <p>I don't know how to add to my Create statement that passes int he values needed to satisfy this relationship.</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