SHARE
TWEET

Untitled

a guest Jan 12th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FluentNHibernate: Id Column Name Ignored
  2. public class OrderHeadMapping : IAutoMappingOverride<OrderHead>
  3. {
  4.     public void Override(AutoMapping<OrderHead> mapping)
  5.     {
  6.         mapping.Schema("[database].[dbo]");
  7.         mapping.Table("OrderHeads");            
  8.  
  9.         mapping.Id(x => x.Id, "desiredColumnName")              
  10.             .Column("desiredColumnName")
  11.             .GeneratedBy.UuidString();
  12.         ...
  13.     }
  14. }
  15.    
  16. <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
  17.   <class xmlns="urn:nhibernate-mapping-2.2" schema="[database].[dbo]" name="OrderHead, Core, Version=1.0.4666.19686, Culture=neutral, PublicKeyToken=null" table="OrderHeads">
  18.     <cache usage="read-write" />
  19.     <id name="Id" type="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  20.       <column name="Id" />
  21.       <generator class="assigned" />
  22.     </id>
  23.     ...
  24.   </class>
  25. </hibernate-mapping>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top