Does Fluent-NHibernate support mapping to procedures?

后端 未结 2 1856
半阙折子戏
半阙折子戏 2021-02-07 19:28

I\'ve been wondering if it\'s possible to have Fluent-NHibernate communicate with stored procedures that already exist and assign mapping from the result set to my own domain ob

相关标签:
2条回答
  • 2021-02-07 20:04

    Just to answer my own question, the answer is no other than you can write xml mapppings for NHibernate and combine them with Fluent-NHibernate mappings. SP mapping for FNH will most likely be added later.

    0 讨论(0)
  • 2021-02-07 20:23

    The trunk version of Fluent NHibernate (on GitHub) supports insert, update and delete stored procedures.

    In your mapping class constructor, call:

    SqlInsert("StoredProcName");
    

    Disclaimer: I haven't tested this myself yet, but it certainly will come in handy soon.

    For more info see this thread in the Fluent NHibernate Google Group.

    0 讨论(0)
提交回复
热议问题