Note that there are some explanatory texts on larger screens.

plurals
  1. POMapping DayOfWeek from the System namespace using Fluent Nhibernate
    primarykey
    data
    text
    <p>I'm currently working on an MVC 3 project which uses Fluent NHibernate. I utilise the System.DayOfWeek enum but when mapping this I received the following error - </p> <pre><code>Stack Trace: [MappingException: Could not determine type for: DayOfWeek, for columns: NHibernate.Mapping.Column(WeekStart)] NHibernate.Mapping.SimpleValue.get_Type() +456 NHibernate.Mapping.SimpleValue.IsValid(IMapping mapping) +40 NHibernate.Mapping.PersistentClass.Validate(IMapping mapping) +123 NHibernate.Mapping.RootClass.Validate(IMapping mapping) +24 NHibernate.Cfg.Configuration.ValidateEntities() +280 NHibernate.Cfg.Configuration.BuildSessionFactory() +43 FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() +54 [FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail. Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 </code></pre> <p>Example usage - </p> <pre><code>Map(x =&gt; x.WeekStart).CustomType(typeof(DayOfWeek)); </code></pre> <p>I've seen this specific question asked on mailing lists and on stackoverflow but the nuances of it never seemed to be fully grasped and the person asking the question is referred to how to use a custom type mapping. </p> <p>I am well aware of how to use the customtype functionality on fluent maps and frequently make use of it. However I don't understand why this enum in particular cannot be mapped. I presume it has something to do with the System namespace to which it belongs?</p> <p>If anyone can shed any light on this I'd be most happy.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload