开发者

Using AutoMapper in POCO?

I currently have a POCO class in my ASP.NET MVC project that handles all business logic. There are no references to other projects or third-party assemblies.

I am also using AutoMapper in my other projects to facilitate mapping between view models / entities. It is a fantastic tool and saves me considerable time when I make changes to fields on a given entity.

However, within my POCO class are a few segments of code that map between entities. The business purpose is t开发者_开发百科o take entities from one data source and update another data source. Here I am manually mapping and I'm finding it annoying to go in and adjust that mapping when I could employ AutoMapper instead.

Is it a good idea or a bad idea to use AutoMapper in my business logic project? Why?


'll respond to your question with a question.

Why would it ever be bad to use AutoMapper to map properties? I cannot think of a reason, besides a concern over taking an external assembly reference, that you would not want to use AutoMapper.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜