I am trying to map read only properties (property with getter and no setter)
via automapping.

Normally I'd expectthe default behavior of FluentNHibernate to map this
directly as Access -> Read Only (since they don't even have private fields)
But it doesn't, and it's OK, because it's hard to tel whether I'm using a
backing field or not, and also to assume that I don't.

Let's say I add
 public virtual string DisplayTitle
 {
     get
     {
         return Name;
     }
 }
To the Product class in FluentNHibernate source Automapping project.

Problem *1*:: When running, I get an incomplete invalid or incomplete
configuration as per: Could not find a setter for 'DisplayTitle'
...

The next thought I had was to use Conventions, I added a IPropertyConvention
as:
public void Apply(IPropertyInstance instance)
{
    if(instance.Property.CanWrite == false)
    {
        instance.Access.ReadOnlyProperty();
    }
}
It seems to do something, since then the problem

Problem *2*:  When running, I get an incomplete invalid or incomplete
configuration yet this time as per:

> {"could not find PropertyAccessor type: nosetter"}

which gets the inner exception:

> {"Could not load type nosetter. Possible cause: no assembly name
> specified.":""}

----------

If I try to use override normally at the specific property, it does work,
but I want to do it as convention.

---------------------

*Notes:*

The reason I'm trying this is trying to make a FluentNHibernate version of
the article:

http://jfromaniello.blogspot.com/2011/03/same-domain-with-conform-and-nhibernate.html

Jose sent me his tries with FNH and I tweaked them a bit, and currently the
only problem that sounds extra work is this one.

I first tried it on the corresponding solution which used NHibernate 3.1 and
FluentNHibernate 1.2 from NUGET,

 then when it didn't work, I tried to get latest DLLs from FluentNHibernate
source, both "Master" and "1.x" branches.

Then to make sure it's not related to our solution I tried what I wrote here
on the sample automapping project in FluentNHibernate source. I tried , both
"Master" and "1.x" branches.after replacing the NHibernate references with
the NHibernate 3.1 DLLs in the FluentnNHibernate source folder
"Tools\NHibenrate\3.x".


Any idea how to fix problem 2 at least?


Thanks a lot.


Regards,


*Mohamed Meligy
*Readify | Senior Developer

M:+61 451 835006 | W: readify.net
[image: Description: Description: Description: Description:
rss_16]<http://gurustop.net>
[image: Description: Description: Description: Description:
cid:image003.png@01CAF81D.6A076510]
<http://www.linkedin.com/in/meligy>  [image:
Description: Description: Description: Description:
cid:image005.png@01CAF81D.6A076510] <http://twitter.com/meligy>
 
<http://www.greatplacetowork.com.au/best/best-companies-australia.php><http://www.readify.net/AboutUs/NewsItem.aspx?id=10>

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.

Reply via email to