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
|
I have transient and persistent entity connected with one to many relation, where persistent entity is on "one" side and transient is on "many" side. When I create mogration, the down migration try delete table contains transient entities but migration up is empty. Should transient entities appear in migrations ? When I try to connect this entities, e.g. PersistentEntity.TransientEntityList.Add(new TransientEntity()), it throws exception "No such table TransientEntity". Can I use transient entities in this way ? I use LightSpeed 4.0 and SQLite database. |
|
|
Yes that should work, but there looks to be an issue there with lazy loaded collections so Ive added in a fix for that and this will be available in the next nightly builds. Transient entities should work with the designer but it looks like there is a bug there too, unfortunately though that is not something I can fix quickly so Ive noted it but for now you will encounter this problem with invalid migration steps appearing in relation to transient entities.
|
|
|
This patch works very well. Unfortunately, when I try to use query with transient entities e.g. UOW.Query |
|
|
Yes thats correct - you cant execute UnitOfWork based queries against transient entities. You can only deal with these via the association holders so any LINQ queries will need to be forced server side by triggering enumeration prior to running queries against them.
|
|
|
For each entity, LightSpeedModelGenerator generates in model properties like this:
Is there a way to not generate that properties for transient entities ? |
|
|
Yes it shouldn't be generating those but it looks like we dont have a check for this in place currently. Ive updated the code gen templates for this and this will be updated as of the next nightly build.
|
|
|
This fix work great, thank you. Can you tell me when will be the next stable release ? |
|
|
The next stable release will be 5.0 which we will be releasing within the next few weeks although we dont have a specific date as such yet. You can grab the nightlies for 5 from the Beta downloads - the only changes currently being made as patches coming from 4.0 fixes at this time so I would treat it as stable despite the beta tag :)
|
|
|
Hello, unfortunately for the transient entities are still generated incorrect migrations. In methods Up() and Down() is generated entry: this.DropColumn ("transiententity_table", null, "ForeginKeyId", true). I'm using version 5.0. |
|
|
Thanks for reporting this. Ive added a fix for this and this will be available in the next nightly build.
|
|