Questions tagged [automapping]

The convention-based Auto Mapping feature of Fluent NHibernate. Not to be confused with AutoMapper, the convention-based object-to-object mapper.

251 questions
1
vote
1 answer

Mapping abstract base classes using Fluent NHibernate Automapper

I'm using Fluent NHibernate's automapper to map the following domain model (via AutoMap.AssemblyOf()), but it's throwing an exception when creating a SessionFactory. class Ticket { Owner TicketOwner { get; set; } Owner CreatedBy {…
Brant Bobby
  • 14,956
  • 14
  • 78
  • 115
1
vote
2 answers

How do I automap a component collection in Fluent NHibernate?

I have a TrackLog that contains a collection of GPS points as a TrackPoint object: public class TrackPoint { public virtual int Id { get; set; } public virtual List TrackPoints { get;set; } } public class TrackLog { public…
Daniel T.
  • 37,212
  • 36
  • 139
  • 206
1
vote
1 answer

Mapping person and employee in Fluent NHibernate

How can I map following queries using Fluent NHibernate (entity, mapping class etc..), the employee ids are stored in identifier tables. Person table contains employee information and non-employee information. SELECT p.Id, p.FirstName, p.LastName …
1
vote
1 answer

Problem Understanding Fluent nHibernate Automapping and Relationship

I am a bit new to Fluent nHibernate and ran into a scenario with my schema I'm not sure how to address. Say I have two tables: Track TrackId UserId Name Users UserId Name Now, what I want to do is have the ability to access the related User object…
1
vote
1 answer

mapping classes nested within another class using fluent nhibernate automapping

How to map a class that has another class nested inside it. I am using automapping. It gives exception 'NHibernate.MappingException: Association references unmapped class: class1+class2' suppose you have public class baseclass { } public class…
GlanT
  • 21
  • 4
1
vote
0 answers

Fluent Hibernate Automapping issues in table definition (all indices not null)

Title: multiple class with same variable name list has issues in table definition (all indices not null) lets say i have two class implementing from one interface public interface IInterface1 { IList myList {get; set;} } public class…
GlanT
  • 21
  • 4
1
vote
0 answers

How can you output properties that were NOT mapped using Value Injecter?

I am using Value Injecter to map DTO->VM and vice versa. Since all models and DTOs are still very much under development, I was wondering if there is a way to output the source object's property names/values that were NOT mapped to the target…
John
  • 3,591
  • 8
  • 44
  • 72
1
vote
1 answer

Fluent nHibernate with Automapping: How to set Inverse on "Child" side of relation

According to this topic Fluent nHibernate with Automapping: How to get a parent or "containg" object from a child I've made class with "parent" property: class Box { public virtual int Id { get; protected set;} public virtual IList
kpkozak
  • 13
  • 3
1
vote
2 answers

S#arp Architecture Repository.DbContext.CommitTransaction() unusual behaviour

I am facing an unusual behaviour with the Repository and Transactions and its making me mad. I have two simple POCO classes Action and Version as follows. There is a one to many relationship from Action->Version. public class Action : Entity { …
1
vote
1 answer

FluentNHibernate: mapping a nullable int Version property

How do I map a Version property using conventions (e.g. IClassConvention, AutomapperConfiguration)? public abstract class Entity { ... public virtual int? Version { get; protected set; } ... }
Brian Low
  • 11,605
  • 4
  • 58
  • 63
1
vote
2 answers

How to debug failed mapping when I only get Null pointer exception

I am using Orika in my project usually with great success. I have added a new type, registered both source and target and when I map it using mapper.mapAsList(sourceList, targetClass) I get the following exception [2015-02-11…
Bick
  • 17,833
  • 52
  • 146
  • 251
1
vote
1 answer

Map derived class as an independent one with FNH's Automap

Basically, I have an ImageMetadata class and an Image class, which derives from ImageMetadata. Image adds one property: byte[] Content, which actually contains binary data. What I want to do is to map these two classes onto one table, but I…
Anton Gogolev
  • 113,561
  • 39
  • 200
  • 288
1
vote
0 answers

AutoMapper - Map values between MVC Model

My Class Model Structure is like below public class ParentModel { . . public IEnumerable child { get; set; } } From DB i will be getting IEnumerable and am mapping that…
Peru
  • 2,871
  • 5
  • 37
  • 66
1
vote
1 answer

Fluent NHibernate automapper: skip an intermediate class w/ table-per-subclass

I'm using the Fluent NHibernate mapper with table-per-subclass to map the following structure: public abstract class A { // properties here } public abstract class B : A { // methods here } public class C : B { // properties here } My…
David Pfeffer
  • 38,869
  • 30
  • 127
  • 202
1
vote
3 answers

AutoMapper map object to Lookup field in MS Dynamics CRM

I am trying to map using AutoMapper. Source object is C# object public class Source { public string comment { get; set; } public string Subject { get; set; } public Account Account{ get; set; } } public…