Hi Hoang,

Sorry for the late reply.

I haven't used AttributePropertyConvention before but it does look possible.
Something like:

public class RTEConvention : AttributePropertyConvention<RTEAttribute>
{
  protected override Apply(RTEAttribute attribute, IPropertyInstance
instance)
  {
     instance.CustomSqlType("NVARCHAR(MAX)");
  }
}

The Type property is for specifying the .net type (in this case it would be
string).

Paul.

On Mon, Mar 1, 2010 at 12:39 AM, Hoang Tang <firefly4...@gmail.com> wrote:

> Paul,
>
> Thanks for the quick reply. A few more questions...
>
> At first I was thinking to use AttributePropertyConvention<T> would that
> also be possible?
>
> Could you give an example (or point me to a guide on it) of using the
> fluent interface mapping to a specific type? like nvarchar(Max) and text? So
> far I am using the default mapping and it's working out great, but I got to
> the point where I need a little tweaking and I couldn't find any guide on
> it.
>
> I see that IPropertyInstance have a Type and SqlType property do I just set
> the SqlType property to whatever I want? What is the Type for?
>
> Best,
>
> Hoang
>
>
>
>
>
> On Sun, Feb 28, 2010 at 6:59 AM, Paul Batum <paul.ba...@gmail.com> wrote:
>
>> Use conventions, see:
>> http://wiki.fluentnhibernate.org/Conventions#Writing_Your_Own_Conventions
>>
>>
>> <http://wiki.fluentnhibernate.org/Conventions#Writing_Your_Own_Conventions>Basically
>> you want to implement IPropertyConvention and IPropertyConventionAcceptance.
>> In the accept method, use reflection to check for the existence of the
>> attribute. In the apply method, use the fluent interface to specify that the
>> type is text (rather than varchar).
>>
>> On Sun, Feb 28, 2010 at 11:22 AM, Hoang Tang <firefly4...@gmail.com>wrote:
>>
>>>  Hi all,
>>>
>>> I want to figure out a way to tell FNH to map all the property that are
>>> string with the RTE attribute to a text field (vs varchar) in the database?
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Fluent NHibernate" group.
>>> To post to this group, send email to fluent-nhibern...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> fluent-nhibernate+unsubscr...@googlegroups.com<fluent-nhibernate%2bunsubscr...@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/fluent-nhibernate?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Fluent NHibernate" group.
>> To post to this group, send email to fluent-nhibern...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> fluent-nhibernate+unsubscr...@googlegroups.com<fluent-nhibernate%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/fluent-nhibernate?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To post to this group, send email to fluent-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@googlegroups.com<fluent-nhibernate%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/fluent-nhibernate?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@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