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 ...
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...
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 ...
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...
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...
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...
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...
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...
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...
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...
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 ...
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...
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 ...
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...
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...
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...
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...
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...
I have the following domain classes:...public class ApplicationDriverLicenseDomain
{
public ApplicationDriverLicenseDomain()
{
CDLTypes = new List<ApplicationLicenseCDLTypeDomain>();
Endorsements = new List<ApplicationLicenseEndors...
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...