This question is locked. New answers and comments are not allowed.
I have a project which is a console application. I have a project which is a data layer for OpenAccess. I create a persistent class in the MyPoject.Data application and then reference the data application from the console application. I am a getting an error that there are no persistent classes (No persistent class could be found...) but there clearly is.
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Text; |
using Telerik.OpenAccess; |
namespace Elevate.Data |
{ |
[Persistent] |
public class Customer |
{ |
public String CustomerName { get; set; } |
public Int32 CustomerNumber { get; set; } |
} |
} |
The namespace is the same and this code resides in the MyProject.Data which I referenced.
Here is the console application code that is throwing the error.
IObjectScope scope = ObjectScopeProvider1.ObjectScope(); |
scope.Transaction.Begin(); |
Customer _customer = new Customer(); |
_customer.CustomerName = "Bob"; |
_customer.CustomerNumber = 123; |
scope.Add(_customer); |
scope.Transaction.Commit(); |
Please somebody help me understand what the issue is.
The full error information is:
No persistent class could be found.
To define persistent classes use the [Persistent] attribute at the class level.
If multiple projects are used additional references must be made in the configuration file.
To update the required references use 'Update Config References' from the OpenAccess menu.
The third line, although I don't understand what it means, looks like it could have some relevancy. It appears something needs to be done in the config but it doesn't say what.
Any help would be greatly appreciated.
Jaime