Thinking about this more, if you are only using this property in the class's namespace, you could simply make it protected.
On Tue, Jun 3, 2014 at 8:01 PM, Alexander Zaytsev <haz...@gmail.com> wrote: > All public visible methods and properties have to be virtual in NHibernate. > > > 2014-06-04 10:14 GMT+12:00 Brandon Perry <bperry.volat...@gmail.com>: > > Why not make hard getter/setter methods then instead of a property? >> >> Not very C#-like, but would resolve your issue. That is all the property >> syntactical sugar does anyway. >> >> >> On Tue, Jun 3, 2014 at 2:55 PM, Marco Giacinti <marco.giaci...@gmail.com> >> wrote: >> >>> 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. >>> >> >> >> >> -- >> http://volatile-minds.blogspot.com -- blog >> http://www.volatileminds.net -- website >> >> -- >> 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. > -- http://volatile-minds.blogspot.com -- blog http://www.volatileminds.net -- website -- 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.