3

How to map Tsql User Defined Function using Fluent NHibernate? I have found a solution which works with hbm.

http://ayende.com/blog/1720/using-sql-functions-in-nhibernate

But I am using ClassMaps.

1 Answer 1

1

I believe that <sql-query> is not yet implemented in FluentNHibernate. There's an open issue on GitHub.

However, you can mix both fluent mappings and .hbm mappings using FluentNHibernate configuration. Here's an example for that: http://www.dotnetguy.co.uk/post/2009/11/01/stored-procedures-with-fluent-nhibernate/

Something like this:

Fluently.Configure()
    .Database(MsSqlConfiguration.MsSql2008.ConnectionString(c => c.Is("...")))
    .Mappings(m => m.FluentMappings.AddFromAssemblyOf<SessionFactory>())
    .Mappings(m => m.HbmMappings.AddFromAssemblyOf<SessionFactory>())
    .BuildSessionFactory();
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.