I tried all types of accessors, always with the same result. The problem seems to be, that, while the implementation has a setter for Id, the interface has not. So I have a gut feeling, that I will either have to include the id setter in the interface or map against a base class.
2009/9/24 Dario Quintana <[email protected]> > Hey Jan, > > I don't know Fluent NHibernate, but you should go for access="backfield" if > you are using auto-properties. > > Cheers. > > > On Thu, Sep 24, 2009 at 9:17 PM, Jan Limpens <[email protected]>wrote: > >> Hello, >> >> I've asked the same thing on stackoverflow, so if someone wants to get the >> points, he/she could go there as well :) >> >> I try to write a (fluent, but that's not the point) mapping against an >> interface >> >> public interface IOrderDiscount : IDomainObject<long> >> >> where >> >> public interface IDomainObject<IdT> : IDomainObject >> >> { >> IdT Id { get; } >> } >> >> like so (and all other thinkable varieties of access strategies) >> >> Id(d => d.Id, "DiscountId") >> >> .GeneratedBy.HiLo("9") >> >> .WithUnsavedValue(0) >> .Access.AsReadOnlyPropertyThroughCamelCaseField(); >> >> but all I get are variations of >> >> Could not find field 'id' in class 'IOrderDiscount' >> >> My base class implements this as >> >> public virtual IdT Id { get; protected set; } >> >> but even using a backing field id does not change a thing. >> >> So I am left to wonder, how I could get this to work... >> Anyone with an idea? Fluent or not... >> >> -- >> Jan >> >> >> > > > -- > Dario Quintana > http://darioquintana.com.ar > > > > -- Jan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" 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/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
