English 中文(简体)
在实体框架4.1中新增加的自动地图绘制机构
原标题:Automapper not mapping entities that are newly added in Entity Framework 4.1 context

我很抱歉,在我首次呼吁把我看到的这个系统的实体名单拉开的时候。 数据。 罚款,我的实体向我的德国移民组织描绘了什么。 我面临的问题是,当我在此背景下增加一个新项目时,它正在从他的背景而不是数据库中撤出。 因此,我看到该名单被撤回到该系统。 数据类型和我的新项目特性是实际的物体类型。

因此,例如,我可能有一个这样的清单:

System.Data.Entity.DynamicProxies.Contact...
System.Data.Entity.DynamicProxies.Contact...
System.Data.Entity.DynamicProxies.Contact...
MyNameSpace.Contact

我创建了一种习俗型转换器,并注意到,动态Proxy型具有源价值,但MyName Space。 接触不具有源价值。 因此,没有用我的类型转换器绘制地图。

最佳回答

页: 1 在你创建实体而不使用建筑商的情况下,在您的标语/标语中建立标/标/代码。

var newContact = context.Contacts.Create();
context.Contacts.Add(newContact);

归还的物体是支持zy装的代理人。

问题回答

暂无回答




相关问题
AutoMapper With Generic Type Inheritance

I m trying to map CustomerDTO with my domain entity ICustomer with AutoMapper. Everything works fine for first inheritance level but not for the others. I m using Interfaces for my domain model since ...

C# automapper nested collections

I have a simple model like this one: public class Order{ public int Id { get; set; } ... ... public IList<OrderLine> OrderLines { get; set; } } public class OrderLine{ public int ...

Automapper, generics, dto funtimes

Here s the deal: I have a report designer where users can create reports based on some predefined datasets. They can select a set of columns to include in the report and then, when the report is ran, ...

Problem with AutoMapper in IIS7 when using signed assemblies

I am trying to use AutoMapper with web application running on IIS 7. The intended use it so map domain types defined in an external dll to view models defined in the IIS application. This works fine ...

asp.net mvc automapper parsing

let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...

热门标签