zzz projects Entity Framework 6 EF 6
Home EF Core 5 Articles Knowledge Base Online Examples
  • Home
  • EF Core 5
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework 6 - Knowledge Base (KB)

62 results for: in tag: automapper

Entity Framework + AutoMapper ( Entity to DTO and DTO to Entity )

I've got some problems using EF with AutoMapper. =/...for example :...I've got 2 related entities ( Customers and Orders ) and they're DTO classes : ... class CustomerDTO { public string CustomerID {get;set;} public string CustomerName {get;set;} ...
automapper c# dto entity-framework
asked by shkipper

Entity Framework, AutoMapper, handling entity updates

I just started using the Entity Framework 1.0 recently and believe I am beginning to feel the pains everyone is talking about. I'm trying to use best practices so I have a set of DTO that get mapped to and from my Entities via AutoMapper....The real catch...
asp.net-mvc automapper c# entity-framework
asked by jason

Automapper : mapping issue with inheritance and abstract base class on collections with Entity Framework 4 Proxy Pocos

I am having an issue using AutoMapper (which is an excellent technology) to map a business object to a DTO where I have inheritance off of an abstract base class within a collection....Here are my objects:...abstract class Payment class CashPayment : Paym...
.net automapper collections entity-framework poco
asked by Ken Burkhardt

Data projection in Entity Framework and Automapper

I want to use AutoMapper to construct a ViewModel (flattening - data projection) for use in an ASP.net MVC app....var tmp = from x in db.Mailings select Mapper.Map<Mailing, MailingViewModel>(x); return View(tmp.ToList()); ...Of course, when I try the samp...
automapper c# entity-framework linq-to-entities
asked by Tom Deleu

ASP.net MVC - Should I use AutoMapper from ViewModel to Entity Framework entities?

I am currently using AutoMapper to map my Entity Framework entities to my View Model:...public class ProductsController : Controller { private IProductRepository productRepository; public ProductsController(IProductRepository productRepository) ...
asp.net-mvc automapper c# entity-framework
asked by Dismissile

Using automapper to map nested objects

I have a Customers EF POCO class which contains a reference to the Address table....The following code seems to work, but I'm not sure it's the cleanest way to do this. Is there a better way to map this using only a single Map call?... [HttpGet] p...
asp.net-mvc automapper entity-framework
asked by Scottie

DTO Pattern + Lazy Loading + Entity Framework + ASP.Net MVC + Auto Mapper

Firstly, Sorry For lengthy question but I have to give some underlying information....We are creating an Application which uses ASP.net MVC, JQuery Templates, Entity Framework, WCF and we used POCO as our domain layer. In our application, there is a WCF ...
asp.net-mvc automapper dto entity-framework lazy-loading
asked by marvelTracker

Domain vs DTO vs ViewModel - How and When to use them?

In a Multi-layer project with Domain layer (DL)/Business (Service) Layer (BL)/Presentation Layer (PL), what is the best approach to deliver Entities to the Presentation Layer?...DO => Domain Object; DTO = Domain Transfer Object; VM => View Model; V => Vie...
asp.net-mvc automapper dto entity-framework viewmodel
asked by Patrick

Mapping a DTO to an Entity with Automapper

I have an Entity Framework POCO with the following structure....public class Entity { public virtual int Id { get; set; } public virtual string Name { get; set; } } ...I've created a Data Transfer Object for this entity to be used by my views....p...
automapper c# entity-framework
asked by Paul Aldred-Bann

How to update an existing Entity from ViewModel using Automapper and EF4 DbContext with Lazy Loading enabled

I am using Automapper to map between Entity and ViewModel object (in both directions). The model uses EF4 DbContext POCOs and needs LazyLoading (and therefore Proxy Generation) enabled. ...I have come across a problem attempting to update an existing enti...
asp.net-mvc automapper dbcontext entity-framework lazy-loading
asked by Paul Taylor

How do i convert a int to an enum and a string using automapper and int from DB

Could someone please explain how I can use Automapper to map from DB int value to a string, using Enums as the collection....I have the following...Enum...public enum Status { Open, Closed } ...EF 4.1 Domain Model...public class MyEntity { ... pub...
automapper c# entity-framework
asked by Mark

Map collection of objects

I am trying to introduce Automapper into an application for the first time, but I keep getting an error saying I have some invalid arguments....My model:...namespace StoreGradesLib.Models { public class Store { [Key] public int Sto...
automapper c# entity-framework
asked by Riddick

How to convert from Expression<Func<DomainType>>predicate to Expression<Func<DTOtype>predicate

Some background: I have in my application multiple layers, two of which are a domain layer and an infrastructure layer which serves as my DAL. In the domain layer, I have implemented a generic repository pattern as such:... public interface IRepository...
automapper domain-driven-design entity-framework expression-trees linq
asked by John Pool

LINQ and AutoMapper

I'm wondering if there is anything I can do to get this working as expected. This works fine in my code:... var roles = _securityContext.Set<Role>(); var roleList = new List<RoleDto>(); foreach (var role in roles) { ...
automapper c# entity-framework linq
asked by Jammer

Saving Viewmodel data to the Database in ASP.NET MVC

I am new to ASP.net MVC and am using a viewmodel rather than viewbags to populate my dropdowns since I've seen most people recommend against them. I have a slick UI that does cascading dropdowns and autocompletes (not shown here) but I can't seem to get ...
asp.net-mvc asp.net-mvc-3 automapper entity-framework
asked by Jim

Automapper, MapFrom and EF dynamic proxies

I have been trying to map my domain objects to a report view model. Things all worked well in testing where I faked the entity framework code out and used a builder to return a fully populated pocco object. Now that I am actually hitting the database and...
automapper c# entity-framework
asked by Andrew

How to map a nullable property to a DTO using AutoMapper?

I'm developing an Azure Mobile Service, in my model some of the relationships are optional, making the properties that represent it to be nullable....For example, my Message entity in my model class is like this:...public partial class Message { publi...
automapper c# entity-framework linq
asked by Uriel Arvizu

Should foreign Id properties be mapped from Model to Dto?

If I have the following model:...public class Customer { public int Id {get; set;} public int CustomerTypeId {get; set;} public virtual CustomerType {get; set;} } ...Should the Dto exclude foreign Id's to look like this:...public class Custome...
automapper c# entity-framework graphdiff
asked by Ivan-Mark Debono

Automapper Projection and LINQ queries with EF6

We have a legacy system with support for multiple languages. The language specific fields is duplicate on each database row - per language with language code as column name prefix. In our EF6 model we us a LocalizedString complex type to hold all the tran...
automapper entity-framework-6 linq
asked by Jonny Bekkum

Automapper many to many mapping

Patrick, thanks for advice about correct question!...EDIT 1:...I have three table for many to many relationship. Like this: ...GoodEntity:...public partial class GoodEntity { public GoodEntity() { this.GoodsAndProviders = new HashSet<GoodA...
.net automapper c# entity-framework
asked by Hellaren

Page 1 of 4
  • 1
  • 2
  • 3
  • 4
  • »

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

EF Extensions
Try for free now