This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello I am evaluating Lightspeed at the moment becuase we are planning on using it in our current project. I ran right into the first problem and cannont figure out, what the solution might be. I set up 2 entity classes (Product and CommodityGroup). A Product always belongs to a commodity group so there's the association. In my console test app, when I execute the following code... LightSpeedContext<MoritzUnitOfWork> context = new LightSpeedContext<MoritzUnitOfWork> ... I get a target invocation exception, holding an inner exception with the message: My test entities are really simple: public class Product : Entity<int>
public class CommodityGroup : Entity<int> What did I do wrong? Thanks in advance and greeting from Europe! André Buss |
|
|
Hi André, LightSpeed objects always have bi-directional relationships. Because of this you need to add an EntityCollection<Product> _products field to your CommodityGroup class. LightSpeed will be looking for the reverse association of the EntityHolder<CommodityGroup> to set up. Try that out and see if that helps :-) Also - if you use the Visual Studio designer this should all be handled for you. If you have only the express version of VS then try our lsgen.exe that we ship as it will do a first run through and generate the classes for you. Let me know if that helps and hi from New Zealand :-) John-Daniel Trask |
|
|
Hi John-Daniel Thank you for the quick resonse. I didn't know that the relationships have to be implemented bi-directionally. It's working now. I have the VS Team System 2008 and somehow cannot find the Designer within the toolbox. I like coding better than dragging and dropping anyway ;-), so that's no problem. André PS.: Is a full featured Linq to MySql support planned for the next version of LightSpeed? |
|