NHibernate: forcing square brackets in schema export?

前端 未结 3 892
[愿得一人]
[愿得一人] 2021-01-18 03:40

Is there a way to tell NHibernate to use square brackets for all table and column names (like [MyColumn]) when generating the SQL schema export for MS SQL Serve

3条回答
  •  忘掉有多难
    2021-01-18 04:21

    Use backticks in your mapping files around the column names. NH should replace these with the correct character for your db dialect (in your case square brackets).

    i.e. use:

    
    

    NB - It won't work with an apostrophe. The backtick is located top left on most keyboards.

提交回复
热议问题