Rafael, it seems that Marco does not want to make this property virtual.

Marco, this is not possible with (Fluent-)NHibernate. All the public /
internal methods of the class* must *be virtual if you want to use lazy
loading.

Or, you can:
- disable lazy loading
- make lazy loading "no-proxy"
http://ayende.com/blog/4378/nhibernate-new-feature-no-proxy-associations

But personally I do not see any issues having virtual property here.

Best Regards,
Alexander



2014-06-05 0:57 GMT+12:00 Rafael Da Silva <silva...@gmail.com>:

> Hi,
> Show you map class...
>
> Exemple.
>
>     public class CRM_Acao : IEntidade //IEntidade >> Ignore this...
>     {
>         public virtual int Id { get; set; }
>
>         public virtual string Descricao { get; set; }
>
>         public virtual string Explicacao { get; set; } //no map
>
>         public virtual CRM_Etapa Etapa { get; set; }
>
>     }
>
>
>         public CRM_AcaoMap()
>         {
>             Table(Recursos.Rec_Repositorio.CRM_Acao);
>
>             Id(x => x.Id, "ac_id").GeneratedBy.Assigned().Not.Nullable();
>
>             Map(x => x.Descricao,
> "ac_descricao").Length(200).Default(string.Empty).Not.Nullable();
>
>              //Ignore this property and column in DB, Just don't mapping.
>             //Map(x => x.Explicacao,
> "ac_explicacao").CustomSqlType("text").Not.Nullable();
>
>
>
>             References(x => x.Etapa,
> Rec_Repositorio.CRM_Acao_tsac__idetapa);
>         }
>
>
> I hope this help you
>
>
> 2014-06-04 8:34 GMT-03:00 Carl Bussema <carl.buss...@gmail.com>:
>
> Haven't used that. Doesn't it work like class maps, where you tell it
>> every property you want to map, and it just ignores the rest?
>>  On Jun 4, 2014 7:19 AM, "Marco Giacinti" <marco.giaci...@gmail.com>
>> wrote:
>>
>>> No, I'm not using AutoMapping or my problem could have been solved
>>> easily due to the fact that AutoMapping has Ignore method to do exactly
>>> what I need!!!
>>> Unfortunately I'd like to use Fluent Mapping...
>>>
>>> Il giorno martedì 3 giugno 2014 21:55:20 UTC+2, Marco Giacinti ha
>>> scritto:
>>>>
>>>> I'd like to know if there's a way to ignore properties using Fluent
>>>> mappings.
>>>>
>>>> I'm posting a sample (please, it's not a real class, just something to
>>>> explain what I need).
>>>>     public class SampleClass
>>>>     {
>>>>         public virtual int Id { get; protected set; }
>>>>         public virtual string S1 { get; set; }
>>>>         public string S2 { get; set; }
>>>>     }
>>>>
>>>> Then I can use something like this to obtain a session factory
>>>>         public static ISessionFactory CreateSession()
>>>>         {
>>>>             return Fluently.Configure()
>>>>                 .Database(SQLiteConfiguration.
>>>> Standard.UsingFile(dbFile).ShowSql())
>>>>                 .Mappings(
>>>>                     m => m.FluentMappings.AddFromAssembly(Assembly.
>>>> GetExecutingAssembly())
>>>>                 )
>>>>                 .ExposeConfiguration(BuildSchema)
>>>>                 .BuildSessionFactory();
>>>>         }
>>>>
>>>> What I'd like to have is that Id and S1 properties are persisted on db,
>>>> while S2 is just a property to help me within my app.
>>>> Problem is that if I do not define S2 as virtual I get an error because
>>>> proxy can't be created...
>>>>
>>>> How can I solve this?
>>>>
>>>> Thanks,
>>>> Marco
>>>>
>>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Fluent NHibernate" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to fluent-nhibernate+unsubscr...@googlegroups.com.
>>> To post to this group, send email to fluent-nhibernate@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/fluent-nhibernate.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Fluent NHibernate" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to fluent-nhibernate+unsubscr...@googlegroups.com.
>> To post to this group, send email to fluent-nhibernate@googlegroups.com.
>> Visit this group at http://groups.google.com/group/fluent-nhibernate.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> At.
> Rafael Da Silva
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fluent-nhibernate+unsubscr...@googlegroups.com.
> To post to this group, send email to fluent-nhibernate@googlegroups.com.
> Visit this group at http://groups.google.com/group/fluent-nhibernate.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fluent-nhibernate+unsubscr...@googlegroups.com.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
Visit this group at http://groups.google.com/group/fluent-nhibernate.
For more options, visit https://groups.google.com/d/optout.

Reply via email to