Question

I'm trying out this ORM & new to this. I have following code:

IObjectScope scope = Database.Get("MyConnection").GetObjectScope();

try
{
   scope.Transaction.Begin();
   Reading r = new Reading();
   r.ReadingURL = reading.ReadingURL;
   r.IsActive = true;
   scope.Add(r);
   scope.Transaction.Commit();
}
finally
{
   scope.Dispose();
}

When I run this I get following error on "Add":

Telerik.OpenAccess.Exceptions.InvalidOperationException: Class 'WritingChallenge.Reading' is persistent but not known in this context.

It seems for some reason database connection is lost? I'm not sure what is the issue here.

Was it helpful?

Solution

The issue here is that the model that was connected to the WritingReplacementConnection was having no information about the WritingChallenge.Reading type.

Did you specify a mappingConfiguration that included this type?

You can also ask this kind of questions in the forums at Telerik Forums - .NET ORM.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top