Page 1 of 1

Problem with HibernateProperty in FluentNhibernate template

Posted: Wed 30 May 2012 07:23
by tiger727
Hi

I am currently using Entity Developer 4.3.169 (NHibernate).

I got a problem with the FluentNhibernate Template. I add a Extended Property onto HibernateProperty called CustomType, I can access the property in NHibernate Template using property.GetProperty("CustomType").

But when I try to access using the same method in FluentNHibernate Template, it saids unknow property CustomType, it seems the HibernateProperty in FluentNHibernate Template doesn't recognize the Extended Property, what can I do to create new properties in the FluentNHibernate? or What is the correct way to access extended property in FluentNHibernate Template?

Re: Problem with HibernateProperty in FluentNhibernate templ

Posted: Fri 01 Jun 2012 12:36
by Shalex
We have checked the latest (4.4.186) version of Entity Developer. It compiles and uses extended properties correctly.
An example:
- an extended property directive

Code: Select all

<#@ extended name="myproperty" owner="Property" type="System.Boolean" Default="True"#>
- its usage

Code: Select all

<#
      foreach (HibernateProperty property in cls.Properties) {
  	    if ((bool)property.GetProperty("myproperty")) {...}
#>
Make sure that:
1) the template with an extended property directive is added to the model
2) you have saved the template with an extended property before generating code for context model

If this doesn't help, please send us your Fluent NHibernate Template, in which an extended property is declared and used, so that we can reproduce the issue in our environment.