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.

2
  • I am using Nhibernate version 3.1.0.4000 and Fluent version 1.2.0.712 Commented Jul 7, 2011 at 16:41
  • What do the entities you're trying to reference look like? Can you just use Reference()? AFAIK <any> mapping is for when your entities are related (or not) in a way that NH's built-in inheritance strategies can't support Commented Jul 8, 2011 at 2:17

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.