object-object-mapping

Domain Driven Design, .NET and the Entity Framework

I'm new to domain driven design but want to learn it and use it for a new application. I will be using Entity Framework for data access. The basic layout so far is: ASP.NET MVC and other clients (mobile devices etc.) | Webservices | Domain Model (Services, Repositories, Aggregates, Entities and Value Objects) | Data Ac...

Nhibernate/Hibernate, lookup tables and object design

Hi, I've got two tables. Invoice with columns CustomerID, InvoiceDate, Value, InvoiceTypeID (CustomerID and InvoiceDate make up a composite key) and InvoiceType with InvoiceTypeID and InvoiceTypeName columns. I know I can create my objects like: public class Invoice { public virtual int CustomerID { get; set; } public virtual ...

Generic object to object mapping with parametrized constructor

I have a data access layer which returns an IDataRecord. I have a WCF service that serves DataContracts (dto's). These DataContracts are initiated by a parametrized constructor containing the IDataRecord as follows: [DataContract] public class DataContractItem { [DataMember] public int ID; [DataMember] public string Titl...

Automapper - Bestpractice of mapping a many-to-many association into a flat object

I have two entities: Employee and Team. What I want is an EmployeeForm that has the Name of the Team. How can I achieve this using AutoMapper? My current "solution" is the following: Mapper.CreateMap<Employee, EmployeeForm>() .ForMember(dest => dest.TeamName, opt => opt.MapFrom(x => x.GetTeams().FirstO...

What are the advantages of using automapper?

Hey all, My question might be silly, but I'm pretty sure I miss a very important part of the issue. I have to do some object to object mapping (between domain classes used in C# project and classes which are sent to flash clients). My first choice was Automapper. But Ive had some issues with it (nested properties, not paramterless cons...