Hi,
I've tried out the Acive Record 2.0 Beta1 with Linq support and came
accross the following. We are using our self written ValueTypes like
IFirstName in our Entitys:
[Property("FirstName", Length = 20, NotNull = true, ColumnType
= "string", Access = PropertyAccess.FieldCamelcaseUnderscore)]
public IFirstName FirstName
{
get { return FirstNameValue.Create(_FirstName);}
set { _FirstName = value.DataBaseValue; }
}
now when I try to select the entity by that property like:
ActiveRecordLinqContext context = new ActiveRecordLinqContext();
ICustomerEntity[] customers = (from w in
context.Session.Linq<CustomerEntity>() where w.FirstName ==
FirstNameValue.Create("Thomas") select w).ToArray();
I get a runtime exception:
Type mismatch in NHibernate.Criterion.SimpleExpression: FirstName
expected type System.String, actual type
Domain.ValueObjects.FirstNameValue
Changing the IFirstName interface into an abstract base class and
overriding the == and != Operators solved the Problem.
Is this the preferred way, or are there other options?
Thanks in advance,
Thomas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---