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.

Reply via email to