fluent nhibernate not generating schema correctly on function -


I feel awkward that it is just my understanding of nHibernate and nHibernate contained.

I have a small console application which exports schema based on a group of units of classes until I do everything that works great:

  public virtual User ID {get} Set; } The public virtual string first name {receives; Set; } Public Virtual String LastName {get; Set; } Public Virtual String Email {get; Set; } Public Virtual UserType UserType {get; Set; } Public Virtual Client Client {get; Set; } Public Virtual String UniqueIdentifier {get; Set; } Public Virtual ILIT & lt; UserAttribute & gt; UserAttributes {get; Set; } / ** Code ** / Public Virtual String GetAttributeValue (string name) {var value = user attributes in the code. FirstOver Default (ua = & gt; U. Attitude Definition. AttributeName == Name); If (value! = Zero) return value value; And return string Empty; }   

If I comment on the function, everything works great even if I have a function return string. Empty, everything works, however, once I add the line back to:

  var value = user properties. FirstOur Default (ua = & gt; U. Attribute Definition.productname == Name);   

Everything goes wrong with this error: id id is not ID map in "unit" & gt; c__DisplayClass1. Its map of identity property For example: ID (x = & gt; x.Id). "

I am using auto mapping what is the cause of this error? I usually understand the error, but it seems that it has failed in an anonymous class. Do I have a wrong misconception about what all this is all about working together? I am definitely a new hibernate novice in both practice and philosophy. I would love to be enlightened!

lambda ua = & gt; Ua.AttributeDefinition.AttributeName == Name creates an internal class to capture the name parameter, runs on every type of autoplay and tries to map it, and unfortunately prepares the compiler as well.

You can apply an automation configuration to exclude compiler-generated sections

  class MyAutomappingConfiguration: DefaultAutomappingConfiguration {public override boolMemap (type type) {return! Type is preferred (typef (compiler-generated attribute), false) & amp; Base.ShouldMap (type); }}    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -