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
0
votes
1 answer
How to use both IAutoMapOverride and IgnoreBase
I have a set of entities which all derive from ModelBase. This includes things like Id,CreatedOn,LastModified.
I want to be able to use DynamicUpdate with all the mappings. How do I do this?
I've tried, without success, adding…

hometoast
- 11,522
- 5
- 41
- 58
0
votes
1 answer
Map property as a value (not association) for using with IUserType conversion
I have this convention:
public class XmlSerializedConvention : IPropertyConvention, IPropertyConventionAcceptance
{
public void Apply(IPropertyInstance instance)
{
…

Vlad
- 3,001
- 1
- 22
- 52
0
votes
1 answer
auto mapping properties from two classes with third class using automapper
I have two classes, say ClassA and ClassB, and I want to map them with ClassC. How can I do it?
ClassA has only 1 property and ClassB has 5 properties. ClassC has 6 properties.
Situation is something as below:
Public ClassC MapRequest(classA id,…

Kapil Garg
- 51
- 1
- 4
0
votes
1 answer
SaveOrUpdate() on auto-mapped parent sets all child foreign keys to NULL
I am using Fluent NHibernate and NHibernate.Core 3 beta 1. I have two classes:
public class Promotion
{
public Promotion()
{
PromotionEntrants = new List();
}
public virtual int Id { get; set; }
…

Andy Morris
- 485
- 3
- 13
0
votes
1 answer
One-to-one mapping in S#arp Architecture
There's a distinct smell of burned out circuits coming from my head, so forgive my ignorance.
I'm trying to setup a one-to-one relationship (well, let Automapper do it) in S#arp Architecture.
I have
public class User : Entity
{
public virtual…

autonomatt
- 4,393
- 4
- 27
- 36
0
votes
1 answer
NHibernate Has Many Relationship with Grandchild Table Containing Multiple Many-to-One References
there are three existing tables defined like the following:
create table business_units (id number(10,0) not null, ... , primary key (id))
create table categories (id number(10,0) not null, ... , primary key (id))
create table paragraphs (
id…

gabe
- 1,873
- 2
- 20
- 36
0
votes
1 answer
autopmapping with UseOverridesFromAssemblyOf doesn't call overriding classes of base class
i'm using automapping with fluent nHibernate, very simply, like so:
Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2008
.ConnectionString(c => c
.Server("(local)\\sql2008")
…

icts_jhonny
- 1
- 1
0
votes
3 answers
Is there a way to ignore a base type/class by namespace in Fluent NHibernate automapping?
Currently, I am using the following code to ignore base types with Fluent NHibernate automapping:
AutoMap.AssemblyOf(new MyDefaultAutomappingConfiguration())
.Conventions.Setup(GetConventions())
…

gabe
- 1,873
- 2
- 20
- 36
0
votes
1 answer
Automapper Mapping Exception with Model and private Properties
I am using AutoMapper to map two objects. ViewModel and Model, where ViewModel Implements InotifyPropertyChanged. How can i map Model to ViewModel. Below is my scenario,
Model
public class Model
{
public string ResultType { get; set;…

Vinay
- 259
- 4
- 19
0
votes
1 answer
How to assert if converter is applied on a type using Fluent Assertions
I need to apply some complex logic for creating map so i have used custom type converter as below:
cfg.CreateMap>().ConvertUsing();
I am using fluentassertions in unit testing and want…

Sudama Tripathi
- 349
- 1
- 5
- 20
0
votes
1 answer
How to work with IUserType in Automapping Fluent NHibernate?
i have a custom type that implemented IUserType.
one of my domain classes have a property of this custom type.
now i want to make Automapping work with this domain, it says that "
An association from the table xyz refers to an unmapped class:…

Tiva
- 33
- 5
0
votes
1 answer
Fluent NHibernate: How do you change the underlying sql type for an automapped collection of strings?
I have a class:
public class ParentClass
{
//other stuff
IList ChildPages
}
When 'IList ChildPages' gets automapped by Fluent NHibernate a 'ChildPages' join table is created with a nvarchar(255) backing field for each…

Mark Rogers
- 96,497
- 18
- 85
- 138
0
votes
1 answer
Fluent NHibernate cascading delete convention for aggregate roots
Question is: how to write convention that prevents deleting entity reference if it inherits from type Root?
I'm using fluent nhibernate and it's auto mapping feature. Turned on cascading delete by default.
Everything was really cool until I finally…

Arnis Lapsa
- 45,880
- 29
- 115
- 195
0
votes
1 answer
AutoMapper mapping from type to type with nested type
I'm using the latest version, with the instance API.
My source type:
public class Source {
public string ValueX { get; set; }
public string ValueY { get; set; }
public string ValueZ { get; set; }
}
My destination type:
public class…

grokky
- 8,537
- 20
- 62
- 96
0
votes
3 answers
AutoMapper only map when target field is null
Is there any option in AutoMappper to only map properties when the target field is null. i.e. only map properties that aren't already set?
I was hoping to do this without having to write an expression for each individual property.
Any help would be…

Matt Whetton
- 6,616
- 5
- 36
- 57