boujnah5207 / sharp-architecture

Automatically exported from code.google.com/p/sharp-architecture
Other
0 stars 0 forks source link

EntityDuplicateChecker should fully support IEntityWithTypedId<IdT> #118

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an entity implementing IEntityWithTypedId<IdT>.
2. Create another entity which references the first entity. (ie: 
ProvinceState would have a Country property).
3. Configure the second entity to use an HasUniqueDomainSignature attribute 
and configure the property of the first entity (ie: Country) to be the 
DomainSignature.
4. Trigger the isValid() method. You will get an exception stating that 
they EntityDuplicateChecker does not know check the value for duplicate 
entries.

What is the expected output? What do you see instead?
The validation should compare the Id of the first entity (ie: Country).

What version of the product are you using? On what operating system?
1.0 RTM

Please provide any additional information below.
The problem is caused because of an error in the EntityDuplicateChecker.cs 
class. The specific error is in the private void 
AppendSignaturePropertyCriteriaTo<IdT>(ICriteria, IEntityWithTypedId<IdT>) 
method and occurs on line 44.

The current code is:
                else if (propertyType.IsSubclassOf(typeof(Entity))) {
                    AppendEntityCriteriaTo(criteria, signatureProperty, 
propertyValue);
                }

and it should be:
                else if 
(propertyType.IsSubclassOf(typeof(IEntityWithTypedId<IdT>))) {
                    AppendEntityCriteriaTo(criteria, signatureProperty, 
propertyValue);
                }

Original issue reported on code.google.com by goo...@deap.ca on 17 Aug 2009 at 5:12

GoogleCodeExporter commented 9 years ago
Fixed with r490.

Original comment by frank.l...@gmail.com on 1 Sep 2009 at 11:02

GoogleCodeExporter commented 9 years ago

Original comment by frank.l...@gmail.com on 1 Sep 2009 at 11:03