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

Entity Framework Core - Knowledge Base (KB)

62 results in tag: automapper

Stored procedure returns complex type, I use AutoMapper to map it to my model but foreign key objects do not get set

I use AutoMapper to map from my DataLayer(EF6 DbFirst AutoGenerated layer) to my ModelLayer(Pocos/Dtos). One thing I am confused about is when using stored procedures they return a complex object such as Customer_GetCustomers_Result so I have to map this ...
asp.net-mvc-5 automapper c# entity-framework entity-framework-6
asked by JTunney

Automapper not setting navigation property values from stored procedure

My ...Customer.Model... has a navigation property:...public Address Address { get; set; } ...I have a stored procedure that has a select that looks like the following: ... SELECT c.*, a.City AS AddressCity, a.State AS AddressState ...Th...
automapper c# entity-framework entity-framework-6
asked by JTunney

Saving AutoMapper mapped Collections of Entities using Entity Framework

I have the following Entity Framework Entities:...public class Region { public int RegionId { get; set; } // Primary Key public string Name { get; set; } public virtual ICollection<Country> Countries { get; set; } // Link Table } public class ...
.net automapper c# entity-framework entity-framework-6
asked by Muhammad Rehan Saeed

Automapper 4.2.1 LINQ projections work only with static Mapper.CreateMap?

I'm trying to use Automapper projections on Entity Framework IQueryables....On application start, I create and add all my mapping profiles which create maps with the non-static CreateMap method. ...All those profiles are registered within my IoC container...
automapper automapper-4 c# entity-framework entity-framework-6
asked by user5326354

Automapper self referencing model projection

I've got a problem handling self referencing model in my application using Automapper Projections. This is how my models look like:...public class Letter { public int? ParentId {get; set;} public Letter ParentLetter {get; set; public int Id...
automapper c# entity-framework entity-framework-6
asked by user5326354

Using ToListAsync() with Automapper ProjectToQueryable()

I have a sync method which I'm trying to convert to async. Basically, the code below projects the data into a DTO, and selects rows and orders them based on properties of the DTO. It also gets only a certain 'page' of the data....return GetDbContext().Ite...
automapper c# entity-framework entity-framework-6
asked by Frank Fajardo

ASP.NET Core with EF Core - DTO Collection mapping

I am trying to use (POST/PUT) a DTO object with a collection of child objects from JavaScript to an ASP.NET Core (Web API) with an EF Core context as my data source. ...The main DTO class is something like this (...simplified of course...):...public class...
asp.net-core asp.net-core-webapi automapper entity-framework-core
asked by jmw

Automapper Projection with Linq OrderBy child property error

I am having an issue using an AutoMapper (version 5.1.1) projection combined with a Linq OrderBy Child property expression. I am using Entity Framework Core (version 1.0.0). I am getting the following error:..."must be reducible node"...My DTO objects ar...
automapper entity-framework-core linq-to-sql projection
asked by mcbowes

How to use automapper to map parent child relation ship between model and viewmodel

public class fooViewModel{ public int id {get; set;} public string companyname {get; set;} public string companyaddress {get; set;} public EmployeeViewModel CotactPerson {get; set;} public EmployeeViewModel Manager {get; set;} } public class Employe...
asp.net-mvc asp.net-mvc-5 automapper entity-framework entity-framework-6
asked by Farrukh Abbas

Using automapper to update entities with relationships

I'm using EF Core and Automapper to update my entities. I have an entity called "Aluno", which has a relationship to "Endereco". Here is the code:...public class Aluno : ApplicationUser{ ... public Endereco Endereco { get; set; } ... } publi...
asp.net-core automapper c# entity-framework-core
asked by Munir

Can I use AutoMapper to map destination inheritance without source inheritance?

I have searched high and low and cannot figure out if there's a way to use AutoMapper (5.2) to map the following EF Core (1.1) scenario. The source classes do not use inheritance as Table-per-Type inheritance is not yet supported and I'm working against ...
automapper c# entity-framework entity-framework-core inheritance
asked by AJ.

EFCore join table and AutoMapper

I want to query all users from my ASP.net Identity Users table and map them to a simple DTO like this:...public class UserDto { public string Firstname { get; set; } public string Lastname { get; set; } public string Email { get; set; } pu...
.net-core automapper c# entity-framework-core
asked by Steffen

Merge multiple sources into a single destination

I want to combine 2 Domain Objects into a single data transfer object using AutoMapper. ...Domain Model:...public class Service { public int Id { get; set; } public string Name { get; set; } public string Description { get; set; } public ...
asp.net-mvc automapper c# entity-framework entity-framework-core
asked by capiono

Automapper ProjectTo<>() issue when using NotMapped/Computed property in Source to map in destination

I am getting the error only when I am using ProjectTo, I could not understand the underlying issue. (Automapper version am using 4.2.1.0) ..."The specified type member 'Tags' is not supported in LINQ to Entities. Only initializers, entity...
automapper c# entity-framework entity-framework-6 linq-to-entities
asked by Harish S

C# Automapper 6.1.1 - Collection/List destination properties loses values Entity Framework 6

I have a problem when mapping collections with Automapper 6 and I can't find a solution. In the ...updatedArticle... object below I have the old ...Created... and ...Updated... values left after mapping since they do not exist on the view model. However t...
automapper automapper-6 c# entity-framework entity-framework-6
asked by Ogglas

C# Entity Framework 6 - AutoMapper 6 - Collections/List - Add and Update works but removing item throws an error

As the title says I can add and update but when it comes to deleting I get an error....The operation failed: The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationsh...
automapper automapper-6 c# entity-framework entity-framework-6
asked by Ogglas

AutoMapper ProjectTo ignoring .Include

I'm learning Automapper, and EF Core, and stumbled onto a problem, while trying to model get-only property, which is calculated based on navigation property. I'm having two models:...public class Parent { public int Id {get;set;} public string Na...
.net automapper entity-framework-core
asked by soralex

AutoMapper setting all properties to NULL on destination

In an ASP.NET Core 1.1 Web API, I am trying to map an entity model to a DTO using AutoMapper....The entity model:...namespace InspectionsData.Models { [Table("property")] public class Property { [Key] [DatabaseGenerated(Databa...
asp.net-core-1.1 asp.net-core-mvc asp.net-core-webapi automapper entity-framework-core
asked by Fabricio Rodriguez

EF and Automapper

I have the following domain classes:...public class ApplicationDriverLicenseDomain { public ApplicationDriverLicenseDomain() { CDLTypes = new List<ApplicationLicenseCDLTypeDomain>(); Endorsements = new List<ApplicationLicenseEndors...
automapper c# entity-framework entity-framework-6
asked by Oleg Sh

automapper unflatten excludes value from parent object

I've a situation where entity framework core (2.0) is performing additional work to a parent table when I update a row in a child table. I've pin-pointed the cause to a value not being set in the unflattened object tree produced by AutoMapper (I'm not say...
automapper dto entity-framework-core repository
asked by Craig

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
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!