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
3
votes
1 answer

How to use AutoMapper 9 with static implementation without DI?

I want to create static implementation of AutoMapper without dependency injection. I'm using ASP.NET CORE 2.2 and AutoMapper 9. I've found similar topic: How to use AutoMapper 9.0.0 in Asp.Net Web Api 2 without dependency injection? Is there any…
Kamil
  • 155
  • 2
  • 8
3
votes
1 answer

Fluent NHibernate AutoMapping SchemaExport - Change object model and Keeping Data

Is there a way for the fluent automapping to alter a schema when the data object model changes (adding a new property to a class), currently it only drops and recreates the database schema, which would lose all the data in the database. Can it use…
3
votes
2 answers

Automapper - need to map a parent property when mapping children

The basic problem is that I have properties on my source parent entities that I need to map to my destination child DTOs when the child entities are mapped to the destination child DTOs. The child entities do not have navigation properties to their…
Bobby Ortiz
  • 3,077
  • 7
  • 35
  • 45
3
votes
1 answer

Castle Windsor, Fluent Nhibernate, and Automapping Isession closed problem

I'm new to the whole castle Windsor, Nhibernate, Fluent and Automapping stack so excuse my ignorance here. I didn't want to post another question on this as it seems there are already a huge number of questions that try to get a solution the Windsor…
Simon
  • 415
  • 1
  • 4
  • 15
3
votes
1 answer

C# - Nhibernate question

I am particularly confused by the following test case: public void TestMapping() { var autoPersistenceModel = AutoMap.AssemblyOf().Where( x => x.Namespace.EndsWith("Descriptors")); var configuration =…
Yippie-Ki-Yay
  • 22,026
  • 26
  • 90
  • 148
3
votes
1 answer

Need help with a 'No persister for:' exception with Fluent Nhibernate Automapping

I'm having some problems with applying NHibernate Fluent Automapping. It worked great in a test project. But now.. Test method [PROJECTNAME].SubscriptionTest.SubscriptionConstructorTest threw exception: NHibernate.MappingException: No persister…
Simply G.
  • 235
  • 2
  • 9
3
votes
3 answers

Using fluent-nhibernate is it possible to automap a Value Object(s) inside an Entity?

I'm using Sharp Architecture and have a number of situations where Value Objects are used in an Entity. Here is an obvious simple example: public class Person : Entity { protected Person(){} public Person(string personName) { …
tlum
  • 913
  • 3
  • 13
  • 30
3
votes
3 answers

Automapping doesn't have an Id mapped

My Entity Class: public class Building { /// /// internal Id /// public virtual long Id { get; set; } .............. } My Mapping: var model = AutoMap.AssemblyOf() …
Gini
  • 96
  • 1
  • 6
3
votes
3 answers

Map the interface to Class (dynamically) that doesnt implement interface C#

This is my first post in Stackoverflow. Thanks to Stackoverflow. My Question: I have one interface in class library. namespace TestClient { public interface IMobileStore { List GetMobileDetails(); int…
user3794983
  • 31
  • 1
  • 2
3
votes
2 answers

Can I automap a tree hierarchy with Fluent NHibernate?

Is it possible to auto map a simple nested object structure? Something like this: public class Employee : Entity { public Employee() { this.Manages = new List(); } public virtual string FirstName { get; set; } …
3
votes
1 answer

fluent nhibernate automap version column

Current code in my convention: public void Apply(FluentNHibernate.Conventions.Instances.IVersionInstance instance) { instance.Column("RowVersion"); instance.Not.Nullable(); instance.UnsavedValue("0"); …
RT.
  • 435
  • 2
  • 9
  • 25
3
votes
4 answers

How can you create Clustered Indexes with Fluent NHibernate?

I am using Fluent-NHibernate (with automapping) to generate my tables but would like to choose a different clustered index than the ID field which is used by default. How can you create clustered indexes with Fluent NHibernate on a field other than…
3
votes
1 answer

Fluent NHibernate Many to many not saving

I'm having a problem trying to get a many to many relationship to save the join record in NHibernate using Automapper in Fluent NHibernate. There are quite a few other posts about this on S.O but so far none of them have solved the problem,…
JoshReedSchramm
  • 2,751
  • 1
  • 27
  • 45
2
votes
1 answer

Fluent NHibernate automapping a private/protected property as the Id

I want to hide the primary key Id property from consumers of my entity classes: public class A { protected virtual int Id { get; set; } public virtual string Name { get; set; } ... etc ... } Making the Id property protected doesn't work…
Tyson
  • 14,726
  • 6
  • 31
  • 43
2
votes
1 answer

Fluent NHibernate Automapping error

This one has me scratching my head, so I'm hoping a second pair of eyes can help me out here. Setup: I've got a base class called DomainEntity that all of my data transfer objects use. It basically only defines a property called Id (which is an…
Carl
  • 1,706
  • 1
  • 17
  • 25