0

I have a object that has a property that is a reference to another type and uses a camel case private member variable as a backing. When I run my application the property value is being returned as null but if I debug and inspect the field it is not null. Here is what the property looks like:

public virtual FileType FileType
{
    get { return this.fileType; }
    set { this.fileType = value; }
}

I am using Fluent NHibernate to do the mapping and this is what the mapping looks like:

this.References<FileType>(x => x.FileType)
    .Column("FileTypeID")
    .LazyLoad()
    .Cascade.SaveUpdate()
    .Access.CamelCaseField();

I have other object with the exact same layout as this one and they work but for some reason this particular object property always return null. Has anyone ever seen anything like this and would be able to give me some idea how to fix it?

Chris B.
  • 51
  • 5
  • Sure that you are successfully using a combination of private field access and reference lazy loading somewhere else in your code ? I guess you may go for a simple property access. – jbl Dec 19 '13 at 17:05
  • I am using T4 templates to generate the class and mappings for this and it is working on other objects. I can't see any difference between this class and the others. I was hoping someone else has seen something like this and could point me in the right direction. – Chris B. Dec 30 '13 at 15:22
  • So still no answers on this one, does anyone have any idea of where to even start looking? – Chris B. Jan 09 '14 at 20:47
  • I feel like this question has moved into the black hole of the internet. I can think of no reason why this would be happening. If anyone has ANY ideas please please please send me something. – Chris B. Mar 14 '14 at 19:45

1 Answers1

0

I had the same issue, out of curiosity I upgraded NHibernate from version 3.3.1.4000 to NHibernate 3.4.1.4000 as I thought it had to be a bug in either NHibernate or Fluent and it went away so assume it was a bug in NHibernate. Just for extra information, I am targeting FluentNhibernate version 1.4.0.0.

willd1985
  • 21
  • 5