-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PersistenceSpecification not working with Compenents mapped #187
Comments
As it turns out, this is because my Adding this to the ctor of Address = new Address(); But... Shouldn't PersistenceSpecification of thrown an exception? If I tried to manually create it like this: var myClass = new MyClass();
myClass.Address.Address1 = "Something"; Then I get an exception... Something not right somewhere? |
What kind of exception? May be you can post a stacktrace? I'm not quite following, I'm sorry |
Sorry.. But that's in 'my' code - not using PersistenceSpecification |
I'm not sure that Persistence Specification can figure out that you're using a component. May be there are some specific way to tell it about that, like CheckReference method that verifies that you have a n-to-one relationship? |
I'm having a look at the code - it seems strange that CheckComponentList exists, but CheckComponent doesn't :( |
Yeah.. that's what I thought... There should be a way of testing this mapping though I think? |
I'm thinking that writing your own extension method like CheckReference is a way to go. |
The correct way to test this would be to instantiate your own instance of the class you want to persist, then use the overload of PersistenceSpecification.VerifyTheMappings that takes an instance of the class. |
@hotgazpacho perfect, thanks |
That sounds like a good idea Alex. On Wed, Nov 7, 2012 at 12:28 AM, Alex Brown [email protected]:
James Gregory Tel: +61 (0) 411 619 513 |
How did you solve this? Extension method? |
I've got the following PersistenceSpecification:
When this is run, the
.CheckProperty(c => c.Address.Address1, "Address 1")
throws an error.Upon looking in my database, I see the Name column has been set (to "Testing") however the columns mapped to the component are not
I've mapped the Address component like this (In MyClassMap)
The text was updated successfully, but these errors were encountered: