0

I was looking to mapper which map my database model class to Viewmodel class.

I found AutoMapper, But It has performance issue, as it takes around 7-8 times than manual mapping, and also major drawback with AutoMapper is It retrieve all the column from database the perform filter.

So I found Mapster which takes almost same time as of manual mapping. But when I try to install it through nuget Package , It give me exception and fail the installation.

This what happening

How to resolve this issue. Or please recommend any other mapper.

Error screenshot

tom redfern
  • 30,562
  • 14
  • 91
  • 126
Programmer
  • 398
  • 1
  • 9
  • 33
  • AutoMapper doesn't retrieve anything from the database. It maps one concrete object to another. It's your data access code that actually retrieves the columns. If you *don't* want to retrieve all of them, just don't. Specify only the columns you need in your SQL or EF query. You may find that performance suffered because you loaded columns that weren't needed – Panagiotis Kanavos Apr 07 '16 at 13:58
  • From @Kross: Sometimes, you need to clean/build project and all back to work normally, sometimes you need to close and re-open VS2015, and sometimes you need to restart you machine, yes, it can resolve the problem. If all of this doesn't resolve this problem, add the reference manually. – Panagiotis Kanavos Apr 07 '16 at 13:58
  • @PanagiotisKanavos : If I'll use AutoMapper then First I'll retrieve all the column then AutoMapper will start mapping my class. Read [this article](http://www.devtrends.co.uk/blog/stop-using-automapper-in-your-data-access-code) – Programmer Apr 07 '16 at 16:04
  • Can you suggest me an alternative so than my query will retrieve only limited number of column. As I'm using Repository pattern. – Programmer Apr 07 '16 at 16:06

1 Answers1

0

Well, faced with the same issue, just install it through package manager console:

PM> Install-Package Mapster
FLCL
  • 2,445
  • 2
  • 24
  • 45