1

Nhibernate documentation specfies ReferenceAny() as a method to do the mapping inheritance trees.

Check doc here. However the code specifies the method as deprecated and will be removed in the next versions. Is there any other way to map this.

M4N
  • 94,805
  • 45
  • 217
  • 260
frictionlesspulley
  • 11,070
  • 14
  • 66
  • 115
  • I am using Nhibernate version 3.1.0.4000 and Fluent version 1.2.0.712 – frictionlesspulley Jul 07 '11 at 16:41
  • What do the entities you're trying to reference look like? Can you just use Reference()? AFAIK mapping is for when your entities are related (or not) in a way that NH's built-in inheritance strategies can't support – Jason Freitas Jul 08 '11 at 02:17

1 Answers1

0

Only the ReferencesAny<TOther>(Member property) overload has been deprecated. ReferencesAny<TOther>(Expression<Func<T,TOther>> memberExpression) is still perfectly valid.

It's the same type of confusion as when people claim that Enum.ToString has been deprecated. The overloads that take an IFormatProvider have been deprecated, but the other ToString overloads are fine. The problem is that Intellisense shows the member stricken-out, even though only a subset of its overloads are actually obsolete.

For more information on using ReferencesAny in Fluent NHibernate, see my other answer: Mapping to multiple tables with Fluent nHibernate

Community
  • 1
  • 1
Daniel Schilling
  • 4,829
  • 28
  • 60