The convention-based Auto Mapping feature of Fluent NHibernate. Not to be confused with AutoMapper, the convention-based object-to-object mapper.
Questions tagged [automapping]
251 questions
6
votes
1 answer
How to automap a collection of components with Fluent NHibernate?
All of my entities and value objects implement marker interfaces IEntity and IValueObject. I have set them up to be treated as components like so:
public override bool IsComponent(Type type)
{
return…

Joran
- 61
- 1
6
votes
2 answers
Fluent nHibernate Automapping not creating Plural table name
I have two tables, Locations and Facilities
They map to two classes,
public Location : Entity
{
//properties
}
public Facility : Entity
{
public virtual Location Location { get; set; }
}
Everything works just dandy, until I change facility…

Jason More
- 6,983
- 6
- 43
- 52
6
votes
1 answer
How can I use Fluent NHibernate Automapping with multiple Lists of the same type in an Entity?
It appears that NHibernate cannot automap more than one IList of a given type in an entity.
Consider the following two entities (based on the Examples.FirstProject sample code that is included with the Fluent NHibernate source code).
public class…

Tom Bushell
- 5,865
- 4
- 45
- 60
6
votes
3 answers
Is there a Fluent NHibernate Automapping sample project that "just works"?
I just started looking at NHibernate this week, and would love to use the Automapping approach on my current project.
I'm working with Fluent NHibernate 1.0.0.594, which I downloaded a few days ago.
I found the Examples.FirstProject in the…

Tom Bushell
- 5,865
- 4
- 45
- 60
6
votes
1 answer
Automapping inheritance with Fluent nhibernate
I have this situation:
public namespace ANamespace
{
public abstract class ABase:IABase
{
//properties
}
public abstract class A : ABase
{
//properties
}
public class A1 : A
{
//properties
…

Athina
- 533
- 5
- 20
5
votes
1 answer
Fluent NHibernate - Flatten multiple rows into a single entity
I have a database table that I cannot change which contains data like:
FooTable
Id | EntityAUniqueId | EntityBUniqueId | EntityCUniqueId
============================================================
1 | A1 | B1 |…

Bronumski
- 14,009
- 6
- 49
- 77
5
votes
3 answers
Value Injecter : Dto to Domain Model (NHibernate)
I am using ValueInjecter to map properties from a Domain model to a DTO served up via a Service Layer. The service in question also accepts updates... so an updated DTO is passed in and this is then injected to the domain object and saved.
//…

Galen
- 309
- 1
- 3
- 15
5
votes
1 answer
What is the best way to provide an AutoMappingOverride for an interface in fluentnhibernate automapper
In my quest for a version-wide database filter for an application, I have written the following code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Automapping;
using…

Tom
- 511
- 3
- 12
5
votes
2 answers
Automapper map from Source to Destination containing List of Objects
I have to create a Mapping with automapper.
Public class Source
{
public string Id;
public string Firstname;
public string Lastname;
}
Destination is
Public class Destination
{
public string Id;
public Person[]…

user2739679
- 827
- 4
- 14
- 24
5
votes
1 answer
AutoMapper - Why it is overwriting whole object?
I don't understand why it's overwriting my whole object. The reason is that I get my User object from db an I want to assign new values from DTO. Instead of just adding those new values it's creating new object that has new values but all previous…

Stan
- 25,744
- 53
- 164
- 242
5
votes
2 answers
Fluent NHibernate enforce Not Nullable on Foreign Key Reference
Just getting my feet wet with some Fluent NHibernate AutoMap conventions, and ran into something I couldn't figure out. I assume I'm just not looking in the right place...
Basically trying to enforce NOT-NULL on the "many" side of the one to many…

Steve Foster
- 141
- 2
- 10
4
votes
3 answers
Fluent NHibernate Automapping: Alter DateTime to Timestamp
I am getting (a little bit to) deep into automapping with the fluent interface of NHibernate. Very nice thing, but I ran into a little problem with DateTimes. I need to change the data format to timestamp, otherwise NHibernate truncates…

Christian Ruppert
- 3,749
- 5
- 47
- 72
4
votes
1 answer
Fluent nhibernate automappings ignore inherited property
I'm using fluent nhibernate to map following model:
public abstract class BasePermission : Entity
{
public abstract string Name { get; }
}
public class ApproveMembershipPermission : BasePermission
{
public override string Name
{
…

Sly
- 15,046
- 12
- 60
- 89
4
votes
5 answers
Complex relationship between tables in NHibernate
I'm writing a Fluent NHibernate mapping for a legacy Oracle database. The challenge is that the tables have composite primary keys. If I were at total freedom, I would redesign the relationships and auto-generate primary keys, but other applications…

Ilya Kogan
- 21,995
- 15
- 85
- 141
4
votes
3 answers
Is it possible to use private field conventions for Fluent NHibernate Automapping?
How can I map to a private field with fluent NHibernate AutoPersistenceModel?
public class A
{
private List myField;
public A()
{
myField = new List();
}
public IList MyBs
…

Paco
- 8,335
- 3
- 30
- 41