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'm trying your product but doc is not so good as possible, but i think it's change soon. So the question is "What's wrong here?" I've got class Post: public class Post:Entity<int> private readonly EntityHolder<Member> _owner = new EntityHolder<Member>(); ... public Member Owner ... } And i'm trying to create new object: Post p = new Post(); p.Owner = Repository.FindOne<Member>(Entity.Attribute("Username") == UserNameTB.Text &&
Thanks! P.S. Sorry for bad english - i'm from Russia ) P.P.S. I've love LightSpeed already ) |
|
|
Hi SynteZZZ, Could you post your Member class as well? Do you have a reference in the Member class to a collection of posts? private readonly EntityCollection<Post> _posts = new EntityCollection<Post>(); public EntityCollection<Post> Posts I'm pleased to hear you are enjoying using LightSpeed, I hope this helps. John-Daniel Trask |
|
|
No, i haven't. But when i add this lines i've got a LightSpeedException - Could not determine the reverse association of [Member.Posts (IList<Post>)]. |
|
|
Hi SynteZZZ, Your Post class should look similar to this: public class Post:Entity<int> private readonly EntityHolder<Member> _owner = new EntityHolder<Member>(); public Member Owner } Note that you need to ensure you have the foreign key field/property for the OwnerID and the Owner object. I have highlighted the part that I suspect you are missing (make sure you change the names if your field isn't called OwnerID). If this does not help could you please post your complete Owner and Post classes? Thanks, John-Daniel Trask |
|