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
1
vote
2 answers

Web API and Entity Framework with a 1 to many to many relationship

I need help on how to get a data from a one to many. I'm using .NET Core 3.1 Web API with Entity Framework. Table 1 : User ID Guid UserName String Table 2 : UsererAgency UserId GUID AgencyCode String Table 3 Agency AgencyCode string AgencyName…
1
vote
1 answer

Fluent NHibernate referencing entity with natural key

I'm using Fluent NHibernate automapping functionality. I've managed to get the database mappings pretty close using conventions, but there are a few things for which I need IAutoMappingOverride. In a legacy system, I have an entity class, 'Campus',…
Ryan.Bartsch
  • 3,698
  • 1
  • 26
  • 52
1
vote
1 answer

Missing Map from 'Object' to 'Object' when using ProjectTo<>

I am working on Web API and have mappings to convert from Domain models to Application models using AutoMapper(10.1.1) I have registered AutoMapper in Application layer public static IServiceCollection ConfigureAppServices(this IServiceCollection…
1
vote
1 answer

FluentNHibernate: How to translate HasMany(x => x.Addresses).KeyColumn("PersonId") into automapping

Say I have these models: public class Person { public virtual int Id { get; private set; } public virtual ICollection
Addresses { get; private set; } } public class Address { public virtual int Id { get; private set; } …
user593358
1
vote
1 answer

Fluent NHibernate AutoMapping PrimaryKey Property Name is not "Id"

I am trying to migrate to Fluent NHibernate and have the following problem :( I have a a number of classes called in the manner of CompanyXXXXXX, which all have a PrimaryKey of "CompanyId" which is of type Company. A HBM Mapping file which i was…
Michal Ciechan
  • 13,492
  • 11
  • 76
  • 118
1
vote
2 answers

Fluent nhibernate Automapping Domain Difficulties

Trying to get my head round automapping. I am having a problem when trying to automap my domain and generate the database. Im sure its something simple im doing wrong. The problem is, the correct tables are generated, but only the ID field from the…
gdp
  • 8,032
  • 10
  • 42
  • 63
1
vote
1 answer

ValueInjecter - recursive mapping

I'm pretty new to auto-mapping, and even newer to ValueInjecter. I'm sorry if this is an easy question, but I can't seem to find the answer anywhere. How would I do a recursive mapping? For example, here is my current factory method that maps a…
Adam Rackis
  • 82,527
  • 56
  • 270
  • 393
1
vote
1 answer

Fluent Nhibernate Automap one to many orphaned records

My problem is that when I remove an object from the one to many relationship the child records get orphaned as opposed to deleted. I'm not sure if it the way I have set up my domain model or I'm not setting something up during the auto map…
Simon
  • 415
  • 1
  • 4
  • 15
1
vote
1 answer

Strange exceptions using FluentNHibernate automapping

I have the following entities in my domain model. A group (an aggregate root) contains items (which are aggregate roots themselves) but an item can only be contained by one group at the time. The code below enforces this. The reason for the group to…
1
vote
1 answer

Fluent NHibernate + AutoMap + Observable

I'm new to Fluent NHibernate but was drawn by the Automapping and otherwise great featureset of the platform. I'm having trouble with getting an ObservableCollection setup, I've scoured the web and tried many different things and all of them have…
1
vote
0 answers

How to configure AutoMapper to map entities

This is Teacher public class Teacher { public int Id { get; set; } public string Education { get; set; } public string Expereince { get; set; } public List Courses { get; set; } public int UserId { get; set; } …
Electronik
  • 11
  • 2
1
vote
1 answer

Creating multiple bi-directial one-to-many associations with Fluent NHibernate automapping

I am fairly new to NHibernate and the .NET framework. I want to map my Project class, which has one-to-many relations Subproject and ProjectTask classes. public class Project : ProjectItem { public virtual IList Subprojects { get;…
abedurftig
  • 1,118
  • 1
  • 12
  • 24
1
vote
2 answers

Complex DAL -> BL mappings using AutoMapper

I'm considering to use AutoMapper in the upcoming project and trying to find possible "bottlenecks". At the moment the most complex case i can imagine is the following: A domain class which is represented by 3 (for example) tables in the database…
UserControl
  • 14,766
  • 20
  • 100
  • 187
1
vote
1 answer

change the constraint name in fluentNhibernate auto mapping alteration

i'm using oracle with FluentNHibernate automapping with alterations & NHibernate the problem is how to specify the constraint name by overriding the mapping model?? the generated sql like this: alter table FirstTable add constraint…
Saw
  • 6,199
  • 11
  • 53
  • 104
1
vote
1 answer

how do i automap an many-to-one relationship using fluent nhibernate

i have the following class: public class Worker { public int WorkerID {get;set;} public string Name { get;set;} } public class TransferOrder { public int TransferOrderID { get;set;} public Worker workerTobeTransfered{get;set;} } how do…
Nour
  • 5,252
  • 3
  • 41
  • 66