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 writing some tests for my migrations. It seems LightSpeed only validates the model the first time when I make a query, it then validates entities in the assembly involved in the query and seems to return the first error it encounters. Is there a way I can give LightSpeed a list of my data assemblies and get a list of all the errors it finds with the models? Werner |
|
|
Just to clarify - when you are saying "validates the model" you mean the checks we perform relating to model correctness (e.g. are any circular references present). If this is correct then the way this occurs is that we load in and validate the entities which are in the reachable graph associated with the entity that you are dealing with (e.g. you might have a model with 3 entities A, B, C where there is a relationship between A and B but C is orphaned, loading A or B would validate both A and B but loading C would only validate C). To achieve what you are after I would suggest a basic helper function which inspects the assembly for anything deriving from Entity and then just constructs a dummy instance which will trigger the validation via the underlying Entity constructor. e.g.
|
|
|
Thanks Jeremy, Because I'm testing my migrations, I'm actually hoping to validate whether my migration for a given database is valid for the model. I did run into issues with the model itself being incorrect and you're suggestion may very well work for that. Werner |
|