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
1
vote
0 answers
Column Property AutoMapping
There is o possibility to create a convention for Column naming:
I have this piece of code:
public AutoPersistenceModel Generate()
{
var result = AutoPersistenceModel.MapEntitiesFromAssemblyOf()
.Where(GetAutoMappingFilter)
…

isuruceanu
- 1,157
- 5
- 23
1
vote
1 answer
Fluent NHibernate.Automapping change data type in Database
I'm new to FluentNHibernate. I am working with AutoMapping. Let's say, I have a database which is generated by NHibernate. There's a table, named Document with 2 columns
Id: int
Description: nvarchar(255)
which is mapped to this class
public class…

Ragnarsson
- 1,715
- 7
- 41
- 74
1
vote
1 answer
How do I use Fluent NHibernate ReferencesAny mapping?
I've read a lot about Fluent NHibernate's ReferencesAny but I haven't seen a complete example. I think I understand most of it, but there is one part I don't get. In the class mapping ReferencesAny(x => x.MemberName) is used to define the…

Russ Petersen
- 765
- 1
- 9
- 29
0
votes
2 answers
Dynamically property .Not.Insert().Not.Update() Mapping Fluent NHibernate
im using the Fluent NHibernate together with the automapping functionality!
I'm currently using the follwing mapping statement to prevent autogenerated column values to be updated / insert
.Override(map => map.Map(d =>…

Daniel W.
- 449
- 10
- 29
0
votes
2 answers
AutoMapper configuration of List
I have an entity and a corresponding DTO
public class PersonEntity {
public int personId;
public List contacts;
}
public class PersonDto {
public int personId;
public List contacts;
}
Using the following map with…

Craig
- 381
- 5
- 22
0
votes
2 answers
FluentNhibernate Custom Primary key Automapping - (dis)allow nulls
If this is the way for hard-coded mapping for nullable and not nullable database fields
// nullable
Map(x => x.FirstName)
.Nullable();
// not nullable
Map(x => x.FirstName)
.Not.Nullable();
How is it done with automapping and…

Sofija
- 713
- 11
- 14
0
votes
1 answer
FLuentNhibernate + Automapping
Anyone that can helt me with FluentNhibernate and automapping?
Check PotentialReasons collection, and InnerException for more detail. ----> FluentNHibernate.Cfg.FluentConfigurationException : An invalid or incomplete configuration was used while…

Thommie
- 67
- 1
- 11
0
votes
1 answer
Fluent NHibernate Automap Joined Sub-Class Setting the Key
When automapping a joined subclass in fluent nhibernate, I can't figure out how to give the joined subclass a primary key.
public class Address:Entity {
public virtual string Address1 { get; set; }
public virtual string Address2 { get; set;…

Aaron Smith
- 3,332
- 4
- 29
- 25
0
votes
2 answers
Fluent NHibernate ShouldMap does not detect my custom attribute
I have been spending a couple of days now to get to know the Fluent NHibernate automapping working model. It is quite nice, but I keep detecting new details missing from my schemas. Now I want to add extra properties to my classes, but not have them…

Jakob Lithner
- 4,225
- 6
- 38
- 59
0
votes
2 answers
Fluent NHibernate: the entity '(method name)' doesn't have an Id mapped.
This is my first time trying Fluent NHibernate and Auto mapping. Unfortunately I have run into an issue that I cannot get past. I'm getting an error saying that a method on one of my classes cannot be mapped.
public class Person
{
public…

Kelly
- 3,292
- 1
- 24
- 24
0
votes
1 answer
DB specific conventions in Fluent NHibernate
I have a set of Fluent NHibernate conventions most of which are database independent. However, there are a couple which are DBMS dependent such one for string properties:
Public Sub Apply(ByVal instance As IPropertyInstance) Implements…

Ryan.Bartsch
- 3,698
- 1
- 26
- 52
0
votes
1 answer
Fluent NHibernate Automappings generating 2 foreign keys for 1 relationship
I have this setup (condensed for brevity)
Class Employee
virtual IList HasInitialed { get; private set; }
Class ChecklistItem
virtual Employee InitialedBy { get; set; }
When this is generated I get these tables
Employee
…

Nick Spiers
- 2,344
- 2
- 19
- 31
0
votes
1 answer
Override FluentNHibernate Auto mapping
I need change for the next class data type assumed by default FluentNHibernate Automapping
public class plaparte
{
public virtual int id { get; private set; }
public virtual int vivos { get; set; }
public virtual int lesionados { get; set; }
public…

Guillermo
- 213
- 3
- 15
0
votes
0 answers
Blazor project is not working (.NET6). What's the problem with the Lifetime cycle/Mapping?
I have a Blazor project (Webassembly)
I want to start the application and it ends with an error message in program.cs
on line: var app = builder.Build();
using myWebapp.Blazor.Server.Data;
using myWebapp.Blazor.Server.Models;
using…

user1531040
- 2,143
- 6
- 28
- 48
0
votes
1 answer
FluenNHibernate .Formula("...") not work
I use FluentNHibernate with AutoMapping.
No custom conventions or alterations are used. Both NHibernate and FluentNHibernate assemblies are of the latest versions. Database is Sqlite3
I try to use the following entities (table per hierarchy):
public…

ILya
- 2,670
- 4
- 27
- 40