Hi
I just got this book
In it there is a .dll for a generic repository. I followed what he did but I always get a error.
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:
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.
My other repositories I wrote work fine. It's just his generic repository.
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.
Mine is in a form that I make like this
Car send = new Car();
send.Name= regForm["Name"];
send.CarID= regForm["ID"];
Authenticate.repository.Create<Car>(send);
I just can't see this effecting it?
Edit
Now I get this error
Entities in 'Entities.CarSet' participate in the 'FK_Car_aspnet_Users' relationship. 0 related 'aspnet_Users' were found. 1 'aspnet_Users' is expected.
I don't know how to add to my Create statement that passes int he values needed to satisfy this relationship.