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
2 answers
How to set the property as lazyloading in fluent-hibernate with auto-mapping?
I am using auto-mapping with flent-hibernate for mapping. I would like if there is a way to set the reference property to be as 'lazy-loading' using IConvention or similar, rather than using separate mapping class?

Heinnge
- 858
- 3
- 8
- 14
0
votes
1 answer
Fluent Auto Mappings with abstract base also part of model
Ok, firstly I hope this makes sense.
I'm trying to use fluent auto mappings for my app based around the following idea.
public abstract class Container
{
public virtual int Id {get; set};
public virtual string Name {get; set;}
}
public class…

Tim Butterfield
- 565
- 5
- 24
0
votes
1 answer
Using an attribute to override FluentNhibernate AutoMapper for manytomany
I would like to use NHibernate Automapper to map the following class:
public class AdminUser: Identity, IIdentityWithRoles
{
public virtual IList Roles { get; set; }
}
Problem is that Automapper creates a manytoone relationship…

Richard
- 21,728
- 13
- 62
- 101
0
votes
1 answer
fluent nhibernate one-to-one with base class
Suppose I have classes:
class Person
{
String FirstName;
String LastName;
Pet Pet;
}
class Pet
{
String Name;
Person Owner;
}
class Cat : Pet
{
Int32 MousesCaught;
}
class Dog : Pet
{
Int32 CatsCaught;
}
And a mapping:
public class PetMap…

Serhiy
- 4,357
- 5
- 37
- 53
0
votes
1 answer
Duplicated reference key - Fluent NHibernate Automapping
I got a problem with automapping in fluent and reference key. Example would be that:
public class ConfigurationCategory
{
public virtual Guid Id { get; private set; }
[NotNull]
public virtual String Name { get; set; }
public…

Johannes
- 1
0
votes
2 answers
NHibernate, not saving when inverse is set to true
I have what seems to be a very simple question but I can't seem to figure it out. If I have a one to many relationship between [Member] and [Mail]
If I take off inverse it all works, it's just when I call instance.inverse that it doesnt save.…

Eitan
- 1,434
- 6
- 21
- 53
0
votes
1 answer
Fluent NHibernate atutomapping, simple question, extra field being added for foreign key relationships
Im sorry if I don't make any sense my brain is fried right now. I just started programming in NHibernate, decided to move to Fluent Nhibernate because of the automapping but I'm having a little trouble, here is the relation it should have:
Here is…

Eitan
- 1,434
- 6
- 21
- 53
0
votes
1 answer
How to map one entity to several DB tables with Fluent Nhibernate automapping conventions
I have one entity CustomProperty in domain model which is used from several other entities.
Product
{
int Id;
Collection CustomProperties;
}
and
Order
{
int Id;
Collection CustomProperties;
}
But in…

Roman Asanov
- 287
- 2
- 6
0
votes
1 answer
NHIbernate 3 can't automap XmlDocument property
I'm trying to map a type where one of the properties is an XmlDocument but I get this error:
NHibernate.MappingException : An association from the table ChangeLog_TestAuditHistory refers to an unmapped class: System.Xml.XmlDocument
I am using…

kelloti
- 8,705
- 5
- 46
- 82
0
votes
1 answer
Dynamic Ignore Member in Automapper 6.2.2
When i did this
TypeMap typeMap = (TypeMap)mappingExpression.GetType().GetField("_typeMap",
BindingFlags.NonPublic | BindingFlags.Instance).GetValue(mappingExpression);
AutoMapper 4.0.4 was getting the typeMap successfully. But in the automapper…

Ramos
- 13
- 5
0
votes
0 answers
Automapper - Map Complex object from Dictionary
I'm trying to map this:
var values = new Dictionary()
{
["Address.City"] = "New York",
["FirstName"] = "First Name",
["LastName"] = "Last Name"
};
into this:
public class Person
{
public string FirstName { get; set;…

Bruno Avelar
- 670
- 4
- 16
0
votes
1 answer
Automapper in MVC Core 2.0 services.AddAutoMapper() behavior
I have a solution like this:
MVC Core 2.0 application <-> Business Class library <-> Domain class library
(ViewModel) <- P1 -> (Dto) <-P2-> (Domain entity)
I created Automapper profiles in each MVC and Business projects for…

Iztoksson
- 980
- 16
- 32
0
votes
1 answer
How to avoid duplicate records in database when using Automapper DTO to Entity
I am trying to CREATE or UPDATE multiple Payment for a single Order.
I would like to update the record if it exists in the database(Primary Key Value is not the default value), and I would like the record to be created if it doesn't exist in the…

Bellash
- 7,560
- 6
- 53
- 86
0
votes
2 answers
FluentNHibernate override generic class
How to override the mapping of generic class?
I have this class:
public abstract class TranslatableEntity : Entity
{
public virtual String Name { get;set; }
// ...
}
And I whant to do this:
public class…

Serhiy
- 4,357
- 5
- 37
- 53
0
votes
2 answers
Fluent NHibernate Mapping Non Required Object using Automapping
I have a composite object set up Project->Appraisal, My appraisal object has a ApprovedMentor object which is not required but when i go to save project Nhib throws and error to say that ApprovedUser has not been set. but its not set because its not…

Simon
- 415
- 1
- 4
- 15