Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 303
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
I'm trying to access new tables in the database via class files I have created and put into the code folder- the class, Repository,IRepository, and hbm.xml file with Embed property set and entry in Windsor.config. I'm getting various errors, but with one that doesn't throw an error, it doesn't pull any data either. Do these files actually need to be made into a dll or is it possible to use them in the code folder? Do you have any example code? Thanks
|
|
|
|
Rank: Advanced Member
Groups: Admin, Administrators, Developers, Registered, HelpDesk, Authorized User Joined: 7/31/2019(UTC) Posts: 77
Was thanked: 8 time(s) in 8 post(s)
|
For .hbm files, right click in your Visual Studio solution explorer, and click "Properties". Update the following properties:
Build Action: Embedded Resource Copy to Output Directory: Do not Copy.
I hope it will solve the missing mapping file issues if you have correctly implemented the hbm files. |
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
You can also try to create a plugin instead of creating a repository in the Ablecommerce Code folder. A working example of a plugin which makes use of a repository, creating and accesing new tables from database and widgets can be seen in this example. https://github.com/AbleCommerce/AC9-Samples
|
|
|
|
Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 303
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
Thanks, Shari. The classes are marked Embedded Resource, Do Not Copy I tried making a plugin and it shows up to install, but after that, I don't seem to be able to call the class. There is no admin page and the tables were already in the database so I didn't have that code in the plugin. Your sample plugin code doesn't really explain much about what all is necessary and it is really cumbersome to make a plugin because of that. If there is no admin page, do we need a route.config? Does the dll need a .config file? Is it really possible to use the class & hbm.xml files in 9.0.2? I could use it in earlier versions. Thanks again for your help- just frustrated here.
|
|
|
|
Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 303
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
I finally got it without creating a plugin. I was using the namespace AbleCommerce.Code and I hadn't added <mapping assembly="AbleCommerce"/> to the nHibernate.config file. For some of our uses, creating a plugin is a pain and overkill since we have never done a site yet where we had to compile the WAP project anyway.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close