This question is locked. New answers and comments are not allowed.
I am currently building a multi-tiered application and am at the DAL/BL stage. I have tables in a database that I want to represent as b.o.'s, but all database access I want to handle through stored proc's. So I want to use the ORM to map out b.o.'s for each of my tables, but I want to separately use the ORM to also generate methods that call the stored proc's I need. I did all this last week and everything worked fine.
I later decided I wanted the b.o.'s in a separate project alongside the business layer, calling it the "value objects" project. I killed off all the b.o.'s from the DAL and re-used OpenAccess to code-gen them in the VO project. I then added a reference from the DAL to the VO's. It seems pretty simple to me. Yet, now when I try to run my unit tests I get the following error:
Telerik.OpenAccess.Exceptions.InvalidOperationException: 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.
This exception occurs when I try to get the scope at the top of every one of my stored proc accessor methods. Here is one example:
The "EdiReceiveSender" is a ORM-generated class in my v.o. project. In my unit test I instantiate one, fill it, then pass it off to this method in the DAL. Again, all this worked just fine when my b.o.'s and sproc accessors were in the DAL together.
I'd greatly appreciate any help.
I later decided I wanted the b.o.'s in a separate project alongside the business layer, calling it the "value objects" project. I killed off all the b.o.'s from the DAL and re-used OpenAccess to code-gen them in the VO project. I then added a reference from the DAL to the VO's. It seems pretty simple to me. Yet, now when I try to run my unit tests I get the following error:
Telerik.OpenAccess.Exceptions.InvalidOperationException: 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.
This exception occurs when I try to get the scope at the top of every one of my stored proc accessor methods. Here is one example:
public bool RetrieveAttributes(EdiReceiveSender sender) |
{ |
IObjectScope scope = Database.Get("connFfops").GetObjectScope(); |
IQueryResult retval = |
StoredProcedures.RetrieveAttributes(scope, sender.UserName, sender.ForwarderCode, sender.Password); |
return false; |
} |
The "EdiReceiveSender" is a ORM-generated class in my v.o. project. In my unit test I instantiate one, fill it, then pass it off to this method in the DAL. Again, all this worked just fine when my b.o.'s and sproc accessors were in the DAL together.
I'd greatly appreciate any help.