-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutoMapper-CodeProject.htm
More file actions
2964 lines (2927 loc) · 210 KB
/
Copy pathAutoMapper-CodeProject.htm
File metadata and controls
2964 lines (2927 loc) · 210 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML>
<!-- saved from url=(0052)http://www.codeproject.com/Articles/61629/AutoMapper -->
<!DOCTYPE html PUBLIC "" ""><HTML><HEAD><META content="IE=11.0000"
http-equiv="X-UA-Compatible">
<TITLE>AutoMapper - CodeProject</TITLE> <LINK href="AutoMapper-CodeProject_files/Main.min.css"
rel="stylesheet" type="text/css">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<META name="Description" content="AutoMapper is an object-object mapper which allows you to solve issues with mapping the same properties from one object of one type to another object of another type. For example, mapping a heavy entity Customer object to the CustomerDTO could be done with AutoMapper automatically.; Author: Andriy Buday; Updated: 1 Mar 2010; Section: Libraries; Chapter: Platforms, Frameworks & Libraries; Updated: 1 Mar 2010">
<META name="Keywords" content="C#, .NET, Dev, Intermediate,Libraries,Platforms, Frameworks & Libraries,Free source code, tutorials">
<META name="Author" content="Andriy Buday">
<META name="Rating" content="General">
<META name="Robots" content="index, follow, NOODP">
<META name="Revisit-After" content="1 days">
<META name="application-name" content="CodeProject">
<META name="msapplication-navbutton-color" content="#FF9900">
<META name="msapplication-tooltip" content="Your Development Resource.">
<META name="msapplication-starturl" content="http://www.codeproject.com/?pinned=true">
<META name="msapplication-task" content="name=Homepage;action-uri=http://www.codeproject.com/;icon-uri=http://www.codeproject.com/favico.ico">
<META name="msapplication-task" content="name=Latest Articles;action-uri=http://www.codeproject.com/script/articles/Latest.aspx;icon-uri=http://www.codeproject.com/favico.ico">
<META name="msapplication-task" content="name=Questions and Answers;action-uri=http://www.codeproject.com/script/Answers/;icon-uri=http://www.codeproject.com/favico.ico">
<META name="msapplication-task" content="name=The Lounge;action-uri=http://www.codeproject.com/Lounge.aspx;icon-uri=http://www.codeproject.com/favico.ico">
<LINK href="//ajax.googleapis.com" rel="dns-prefetch"> <LINK href="/Articles/61629/AutoMapper"
rel="canonical"> <LINK title="CodeProject Latest articles - All Topics" href="http://www.codeproject.com/WebServices/ArticleRSS.aspx?cat=1"
rel="alternate" type="application/rss+xml"> <LINK title="CodeProject Latest articles - Android"
href="http://www.codeproject.com/WebServices/ArticleRSS.aspx?cat=22" rel="alternate"
type="application/rss+xml"> <LINK title="CodeProject Latest articles - C++"
href="http://www.codeproject.com/WebServices/ArticleRSS.aspx?cat=2" rel="alternate"
type="application/rss+xml"> <LINK title="CodeProject Latest articles - C#" href="http://www.codeproject.com/WebServices/ArticleRSS.aspx?cat=3"
rel="alternate" type="application/rss+xml"> <LINK title="CodeProject Latest articles - Web"
href="http://www.codeproject.com/WebServices/ArticleRSS.aspx?cat=23" rel="alternate"
type="application/rss+xml"> <LINK title="CodeProject Latest articles - Mobile"
href="http://www.codeproject.com/WebServices/ArticleRSS.aspx?cat=18" rel="alternate"
type="application/rss+xml"> <LINK title="CodeProject Lounge Postings" href="http://www.codeproject.com/webservices/LoungeRSS.aspx"
rel="alternate" type="application/rss+xml"> <LINK title="CodeProject" href="http://www.codeproject.com/info/OpenSearch.xml"
rel="search" type="application/opensearchdescription+xml"> <LINK href="/favicon.ico"
rel="icon" type="image/ico"> <LINK href="/favicon.ico" rel="shortcut icon" type="image/ico">
<LINK href="/images/FavIcon-Apple.png" rel="apple-touch-icon" type="image/png">
<SCRIPT language="Javascript" type="text/javascript">//<![CDATA[
function defrm () { /* thanks twitter */ document.write = ''; window.top.location = window.self.location; setTimeout(function() { document.body.innerHTML = ''; }, 0); window.self.onload = function(evt) { document.body.innerHTML = ''; }; }if (window.top !== window.self) { try { if (window.top.location.host) { /* will throw */ } else { defrm(); /* chrome */ } } catch (ex) { defrm(); /* everyone else */ } }if (typeof(DemoUrl)!='undefined') document.write(unescape('%3Cme')+'ta http'+'-equiv="re'+'fresh" con'+'tent="1;url='+DemoUrl+unescape('"%3CE'));
function _dmBootstrap(file) { var _dma = document.createElement('script'); _dma.type = 'text/javascript'; _dma.async = true; _dma.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + file; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(_dma);}
function _dmFollowup(file) { if (typeof DMAds === 'undefined') _dmBootstrap('cdn2.developermedia.com/a.min.js?dt=2.8.140609.1');}
(function () { _dmBootstrap('cdn1.developermedia.com/a.min.js?dt=2.8.140609.1'); setTimeout(_dmFollowup, 2000);})();
//]]>
</SCRIPT>
<SCRIPT type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1735123-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_setDomainName', 'www.codeproject.com']);
_gaq.push(['_setSessionTimeout', '1200']);
(function () {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
</SCRIPT>
<META name="GENERATOR" content="MSHTML 11.00.9600.17126"></HEAD>
<BODY class="internetexplorer internetexplorer11"><A class="access-link" href="http://www.codeproject.com/Articles/61629/AutoMapper#Main"><IMG
alt="Click here to Skip to main content" src="AutoMapper-CodeProject_files/t.gif"></A>
<DIV class="page-background">
<TABLE class="banner fixed" id="ctl00_Bn" style="width: 100%; height: 135px;"
cellspacing="0" cellpadding="0">
<TBODY>
<TR valign="bottom">
<TD class="blank-background" style="height: 31px;"> </TD>
<TD class="blank-background" style="width: 250px; height: 135px;" rowspan="3"><A
href="http://www.codeproject.com/"><IMG tabindex="1" title="CodeProject"
id="ctl00_Logo" style="border-width: 0px; width: 250px; height: 135px;"
alt="Home" src="AutoMapper-CodeProject_files/logo250x135.gif"></A></TD>
<TD class="blank-background align-right"
style="width: 728px; height: 31px;">
<DIV class="container memberbar clearfix">
<DIV class="float-left" id="ctl00_MemberMenu_GenInfo">10,666,323 members
(45,022 online) </DIV>
<DIV class="float-left"></DIV>
<DIV class="float-right"><SPAN class="tooltip" id="ctl00_MemberMenu_WorkspaceMenu"><A
href="http://workspaces.codeproject.com/?from=topbar"><IMG width="110"
height="16" style="margin: -2px 25px 0px 0px; border: 0px currentColor; border-image: none; vertical-align: middle;"
src="AutoMapper-CodeProject_files/workspaces32.png"></A>
<DIV class="tooltip-flyout workspaces">
<H3>CodeProject::Workspaces</H3>
<P class="bold">Code. Collaborate. Organize.</P>
<DIV class="list-item"><A href="https://workspaces.codeproject.com/?from=topbar-menu">Workspaces
Home</A></DIV>
<DIV class="list-item"><A href="http://www.codeproject.com/Forums/1854922/Workspaces-Forum.aspx">Discuss
Workspaces</A></DIV>
<P class="bold" style="margin-top: 10px;">No Limits. <A href="https://workspaces.codeproject.com/">Try
it Today.</A></P></DIV></SPAN>
<SCRIPT type="text/javascript">//<!--
function doSubmit(secure)
{
if (secure)
document.subForm.action = "https://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fArticles%2f61629%2fAutoMapper"
else
document.subForm.action = "https://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fArticles%2f61629%2fAutoMapper"
document.subForm.submit();
return true;
}//-->
</SCRIPT>
<A name="SignUp"></A> <SPAN
class="member-signin tooltip openable"><SPAN><A href="https://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fArticles%2f61629%2fAutoMapper">Sign
in</A></SPAN>
<DIV class="tooltip-flyout">
<FORM name="subForm" class="tight" id="subForm" action="https://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fArticles%2f61629%2fAutoMapper"
method="post"><INPUT name="FormName" id="FormName" type="hidden" value="MenuBarForm">
<DIV>Email</DIV>
<DIV><INPUT name="Email" class="small-text" id="Email" type="email"></DIV>
<DIV>Password</DIV>
<DIV><INPUT name="Password" class="small-text" id="Password" type="password"></DIV>
<DIV class="action">
<SCRIPT type="text/javascript">
function Join(){
var url = 'http://www.codeproject.com/script/Membership/Modify.aspx?meml=' + document.subForm.Email.value;
document.location.href=url;return false;
}
document.write('<input type="button" class="create" onclick="return Join();" value="Join"');
document.write('<input type="hidden" name="fld_quicksign" value="true" />');
</SCRIPT>
<INPUT class="signin" onclick="return doSubmit(false);" type="submit" value="Sign in">
</DIV>
<DIV class="container"> <A class="forgot float-right"
id="ctl00_MemberMenu_SendPassword" href="http://www.codeproject.com/script/Membership/SendPassword.aspx?rp=%2fArticles%2f61629%2fAutoMapper">Forgot
your password?</A> </DIV></FORM>
<HR class="divider-dark">
Sign in using <A title="Sign in using Facebook" class="oauth" href="http://www.codeproject.com/script/Membership/OAuthLogOn.aspx?auth=Facebook"><IMG
style="border: 0px currentColor; border-image: none; padding-right: 3px; vertical-align: middle;"
src="AutoMapper-CodeProject_files/facebook.png"></A> <A title="Sign in using Google"
class="oauth" href="http://www.codeproject.com/script/Membership/OAuthLogOn.aspx?auth=Google"><IMG
style="border: 0px currentColor; border-image: none; padding-right: 3px; vertical-align: middle;"
src="AutoMapper-CodeProject_files/google-plus.png"></A> <A title="Sign in using Linkedin"
class="oauth" href="http://www.codeproject.com/script/Membership/OAuthLogOn.aspx?auth=LinkedIn"><IMG
style="border: 0px currentColor; border-image: none; padding-right: 3px; vertical-align: middle;"
src="AutoMapper-CodeProject_files/linkedin.png"></A>
</DIV></SPAN></DIV></DIV></TD>
<TD class="blank-background" style="height: 31px;"> </TD></TR>
<TR valign="middle">
<TD class="theme1-background" style="height: 94px;"> </TD>
<TD class="theme1-background ad">
<DIV class="msg-728x90" data-tags="C#, .NET, Dev, Intermediate,rating4.5"
data-zone="ros" data-publisher="lqm.codeproject.site" data-type="ad"
data-format="728x90"></DIV></TD>
<TD class="theme1-background" style="height: 94px;"> </TD></TR>
<TR valign="top">
<TD style="height: 14px;"></TD>
<TD class="blank-background" style="height: 14px;"></TD>
<TD style="height: 14px;"></TD></TR></TBODY></TABLE><A href="http://www.codeproject.com/Articles/61629/AutoMapper#Main"><IMG
class="access-link" alt="Click here to Skip to main content" src="AutoMapper-CodeProject_files/t.gif"></A>
<DIV class="sub-headerbar fixed" id="ctl00_TPR">
<TABLE class="extended" cellspacing="0" cellpadding="0">
<TBODY>
<TR>
<TD nowrap="nowrap">
<DIV class="navbar clearfix">
<UL class="navmenu openable">
<LI><A id="ctl00_TopNavBar_Home"
href="http://www.codeproject.com/">home</A>
<LI class="openable"><A class="down selected" id="ctl00_TopNavBar_Art"
href="http://www.codeproject.com/script/Articles/Latest.aspx">articles</A>
<UL>
<LI class="openable"><A class="fly" id="ctl00_TopNavBar_ArtTopicList"
onmouseover="navBarMenu.ShowMap(this, 'ctl00_TopNavBar_MapFlyout');"
href="http://www.codeproject.com/script/Content/SiteMap.aspx">Chapters
and Sections<SPAN class="has-submenu">></SPAN></A>
<UL id="ctl00_TopNavBar_MapFlyout">
<LI>
<DIV id="siteMap"><IMG style="margin: 150px; width: 100px; height: 100px;"
alt="loading" src="AutoMapper-CodeProject_files/animated.gif">
</DIV></LI></UL></LI>
<LI><A class="fly break" id="ctl00_TopNavBar_ArtSearch" href="http://www.codeproject.com/search.aspx">Search</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_ArtLatestArts" href="http://www.codeproject.com/script/Articles/Latest.aspx?at=1,3,7">Latest
Articles</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_ArtLatestTips" href="http://www.codeproject.com/script/Articles/Latest.aspx?at=6">Latest
Tips/Tricks</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_ArtTop" href="http://www.codeproject.com/script/Articles/TopArticles.aspx?ta_so=5">Top
Articles</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_ArtBeginner" href="http://www.codeproject.com/search.aspx?aidlst=152&sa_us=True">Beginner
Articles</A></LI>
<LI><A class="fly break" id="ctl00_TopNavBar_ArtBlogArticles" href="http://www.codeproject.com/script/Articles/BlogArticleList.aspx">Technical
Blogs</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_ArtGuide" href="http://www.codeproject.com/info/Submit.aspx">Posting/Update
Guidelines</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_ArtHelpForum" href="http://www.codeproject.com/Forums/1641/Article-Writing.aspx">Article
Help Forum</A></LI>
<LI><A class="fly break" id="ctl00_TopNavBar_ArtCompetition" href="http://www.codeproject.com/script/Awards/CurrentCompetitions.aspx?cmpTpId=1">Article
Competition</A></LI>
<LI><A class="fly highlight1" id="ctl00_TopNavBar_ArtPostArticle"
href="http://www.codeproject.com/script/Articles/Submit.aspx"><IMG
width="19" height="13"
src="AutoMapper-CodeProject_files/write-gr.png"> Submit an article or
tip </A></LI>
<LI><A class="fly highlight2" id="ctl00_TopNavBar_ArtPostBlog" href="http://www.codeproject.com/script/Articles/BlogFeed.aspx"><IMG
width="19" height="13"
src="AutoMapper-CodeProject_files/write-or.png"> Post your Blog
</A></LI>
<LI class="last"></LI></UL></LI>
<LI class="openable"><A id="ctl00_TopNavBar_Answers" href="http://www.codeproject.com/script/Answers/List.aspx?tab=active">quick
answers</A>
<UL>
<LI id="ctl00_TopNavBar_AQL"><A class="fly highlight1" id="ctl00_TopNavBar_ArticleQuestion"
href="http://www.codeproject.com/Articles/61629/AutoMapper#_comments"><IMG
width="19" height="13"
src="AutoMapper-CodeProject_files/write-gr.png"> Ask a Question about
this article</A></LI>
<LI><A class="fly highlight2" id="ctl00_TopNavBar_QAAsk" href="http://www.codeproject.com/Questions/ask.aspx"><IMG
width="19" height="13"
src="AutoMapper-CodeProject_files/write-or.png"> Ask a
Question</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_QAUnanswered" href="http://www.codeproject.com/script/Answers/List.aspx?tab=unanswered">View
Unanswered Questions</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_QALatest" href="http://www.codeproject.com/script/Answers/List.aspx?tab=active">View
All Questions...</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_QATR_ctl00_Tag" style="padding-left: 30px;"
href="http://www.codeproject.com/script/Answers/List.aspx?tab=active&alltags=true&tags=81">C#
questions</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_QATR_ctl01_Tag" style="padding-left: 30px;"
href="http://www.codeproject.com/script/Answers/List.aspx?tab=active&alltags=true&tags=85">ASP.NET
questions</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_QATR_ctl02_Tag" style="padding-left: 30px;"
href="http://www.codeproject.com/script/Answers/List.aspx?tab=active&alltags=true&tags=842">VB.NET
questions</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_QATR_ctl03_Tag" style="padding-left: 30px;"
href="http://www.codeproject.com/script/Answers/List.aspx?tab=active&alltags=true&tags=308">C#4.0
questions</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_QATR_ctl04_Tag" style="padding-left: 30px;"
href="http://www.codeproject.com/script/Answers/List.aspx?tab=active&alltags=true&tags=87">Javascript
questions</A></LI>
<LI class="last"></LI></UL></LI>
<LI class="openable"><A id="ctl00_TopNavBar_Forums" href="http://www.codeproject.com/script/Forums/List.aspx">discussions</A>
<UL>
<LI><A class="fly" id="ctl00_TopNavBar_MessageBoardsAll" href="http://www.codeproject.com/script/Forums/List.aspx">All
Message Boards...</A></LI>
<LI class="openable"><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1580997/Application-Lifecycle.aspx">Application
Lifecycle<SPAN class="has-submenu">></SPAN></A>
<UL class="openable">
<LI><A class="fly" href="http://www.codeproject.com/Forums/1533717/Running-a-Business.aspx">Running
a Business</A></LI>
<LI><A class="fly" href="http://www.codeproject.com/Forums/1533716/Sales-Marketing.aspx">Sales
/ Marketing</A></LI>
<LI><A class="fly" href="http://www.codeproject.com/Forums/1651/Collaboration-Beta-Testing.aspx">Collaboration
/ Beta Testing</A></LI>
<LI><A class="fly" href="http://www.codeproject.com/Forums/3304/Work-Training-Issues.aspx">Work
& Training Issues</A></LI></UL></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/369270/Design-and-Architecture.aspx">Design
and Architecture</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/12076/ASP-NET.aspx">ASP.NET</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1580226/JavaScript.aspx">JavaScript</A></LI>
<LI class="openable"><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1647/C-Cplusplus-MFC.aspx">C
/ C++ / MFC<SPAN class="has-submenu">></SPAN></A>
<UL class="openable">
<LI><A class="fly" href="http://www.codeproject.com/Forums/4486/ATL-WTL-STL.aspx">ATL
/ WTL / STL</A></LI>
<LI><A class="fly" href="http://www.codeproject.com/Forums/3785/Managed-Cplusplus-CLI.aspx">Managed
C++/CLI</A></LI></UL></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1827459/Adobe-Technologies.aspx">Adobe
Technologies</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1649/Csharp.aspx">C#</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1627782/Free-Tools.aspx">Free
Tools</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1827460/Objective-C.aspx">Objective-C</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1832431/Ruby-On-Rails.aspx">Ruby
On Rails</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1725/Database.aspx">Database</A></LI>
<LI class="openable"><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/186301/Hardware-Devices.aspx">Hardware
& Devices<SPAN class="has-submenu">></SPAN></A>
<UL class="openable">
<LI><A class="fly" href="http://www.codeproject.com/Forums/1644/System-Admin.aspx">System
Admin</A></LI></UL></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1606152/Hosting-and-Servers.aspx">Hosting
and Servers</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1643/Java.aspx">Java</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1650/NET-Framework.aspx">.NET
Framework</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1848626/Android.aspx">Android</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/13695/Mobile.aspx">Mobile</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1540733/Sharepoint.aspx">Sharepoint</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1004257/Silverlight-WPF.aspx">Silverlight
/ WPF</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1646/Visual-Basic.aspx">Visual
Basic</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/Forums/1640/Web-Development.aspx">Web
Development</A></LI>
<LI><A class="fly" style="padding-left: 30px;" href="http://www.codeproject.com/suggestions.aspx">Site
Bugs / Suggestions</A></LI>
<LI class="last"></LI></UL></LI>
<LI class="openable"><A id="ctl00_TopNavBar_Features" href="http://www.codeproject.com/Feature/">features</A>
<UL>
<LI><A class="fly highlight1" id="ctl00_TopNavBar_CPTV" href="http://codeproject.tv/"><IMG
width="24" height="24" style="vertical-align: text-bottom;" alt="CP.TV"
src="AutoMapper-CodeProject_files/CPTV-24.png">CodeProject.TV</A></LI>
<LI><A class="fly break" id="ctl00_TopNavBar_DiscussCPTV" href="http://www.codeproject.com/Forums/1829610/CodeProject-TV.aspx">Discuss
CodeProject.TV</A>
<LI><A class="fly" id="ctl00_TopNavBar_Catalog" href="http://www.codeproject.com/script/Catalog/List.aspx">Component
& Service Catalog</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_Comps" href="http://www.codeproject.com/script/Awards/CurrentCompetitions.aspx?cmpTpId=1&awsac=true">Competitions</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_News" href="http://www.codeproject.com/script/News/List.aspx">News</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_Insider" href="http://www.codeproject.com/Feature/Insider/">The
Insider Newsletter</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_DailyBuild" href="http://www.codeproject.com/Feature/DailyBuild">The
Daily Build Newsletter</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_Newsletters" href="http://www.codeproject.com/script/Mailouts/Archive.aspx?mtpid=1">Newsletter
archive</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_Surveys" href="http://www.codeproject.com/script/Surveys/List.aspx">Surveys</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_Showcase" href="http://www.codeproject.com/KB/showcase/">Product
Showcase</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_Research" href="http://www.codeproject.com/script/ResearchLibrary/Index.aspx">Research
Library</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_Stuff" href="http://www.codeproject.com/Info/Stuff.aspx">CodeProject
Stuff</A></LI>
<LI class="last"></LI></UL></LI>
<LI class="openable"><A id="ctl00_TopNavBar_Lounge" href="http://www.codeproject.com/Lounge.aspx">community</A>
<UL>
<LI><A class="fly" id="ctl00_TopNavBar_InsiderLnk" href="http://www.codeproject.com/Insider.aspx">The
Insider News</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_LoungeLnk" href="http://www.codeproject.com/Lounge.aspx">The
Lounge </A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_WeirdWonderful" href="http://www.codeproject.com/Feature/WeirdAndWonderful.aspx">The
Weird & The Wonderful</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_SoapBoxLnk" href="http://www.codeproject.com/Forums/1536756/The-Soapbox.aspx">The
Soapbox</A></LI>
<LI><A class="fly break" id="ctl00_TopNavBar_PRLnk" href="http://www.codeproject.com/Forums/1738007/Press-Releases.aspx">Press
Releases</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_WhosWho" href="http://www.codeproject.com/script/Membership/Profiles.aspx">Who's
Who</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_MVPs" href="http://www.codeproject.com/script/Awards/MVPWinners.aspx">Most
Valuable Professionals</A></LI>
<LI><A class="fly break" id="ctl00_TopNavBar_Companies" href="http://www.codeproject.com/script/Membership/Profiles.aspx?mgtid=1&mgm=True">Company
Listings</A></LI>
<LI class="openable"><A class="fly" href="http://www.codeproject.com/Forums/1580229/Hindi.aspx">Non-English
Language <SPAN class="has-submenu">></SPAN></A>
<UL>
<LI><A class="fly" href="http://www.codeproject.com/Forums/1580229/Hindi.aspx">General
Indian Topics</A></LI>
<LI><A class="fly" href="http://www.codeproject.com/Forums/1580230/Chinese.aspx">General
Chinese Topics</A></LI></UL>
<LI class="last"></LI></UL></LI>
<LI class="openable" style="margin-left: 20px;"><A id="ctl00_TopNavBar_Help"
href="http://www.codeproject.com/KB/FAQs/">help</A>
<UL>
<LI><A class="fly" id="ctl00_TopNavBar_HelpWhatIs" href="http://www.codeproject.com/info/guide.aspx">What
is 'CodeProject'?</A></LI>
<LI><A class="fly break" id="ctl00_TopNavBar_HelpGeneral" href="http://www.codeproject.com/KB/FAQs/">General
FAQ</A></LI>
<LI><A class="fly break highlight1" id="ctl00_TopNavBar_HelpPostQuestion"
href="http://www.codeproject.com/Questions/ask.aspx">Ask a
Question</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_HelpBugs" href="http://www.codeproject.com/suggestions.aspx">Bugs
and Suggestions</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_HelpArticles" href="http://www.codeproject.com/Forums/1641/Article-Writing.aspx">Article
Help Forum</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_HelpSiteMap" href="http://www.codeproject.com/script/Content/SiteMap.aspx">Site
Map</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_HelpAdvertise" href="http://developermedia.com/">Advertise
with us</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_HelpJobs" href="http://www.codeproject.com/info/Jobs/">Employment
Opportunities</A></LI>
<LI><A class="fly" id="ctl00_TopNavBar_HelpAboutUs" href="http://www.codeproject.com/info/about.aspx">About
Us</A></LI>
<LI class="last"></LI></UL></LI></UL></DIV></TD>
<TD align="right">
<DIV class="searchbar">
<FORM name="Search" class="tight" action="/search.aspx" method="get">
<TABLE class="search" border="0" cellspacing="0" cellpadding="0">
<TBODY>
<TR>
<TD><INPUT name="q" tabindex="2" class="search " id="sb_tb"></TD>
<TD><INPUT type="image" src="AutoMapper-CodeProject_files/search.gif"></TD></TR></TBODY></TABLE>
<DIV class="hover-container">
<DIV class="search-advanced popup small-text align-left"
id="SearchFilter"><B>Search within:<BR></B> <INPUT name="sbo" id="sb_kw"
type="radio" value="kw"><LABEL for="sb_kw">Articles</LABEL><BR><INPUT
name="sbo" id="sb_sws" type="radio" value="sws"><LABEL
for="sb_sws">Workspaces</LABEL><BR><INPUT name="sbo" id="sb_vkw" type="radio"
value="vkw"><LABEL for="sb_vkw">Videos</LABEL><BR><INPUT name="sbo" id="sb_qa"
type="radio" value="qa"><LABEL for="sb_qa">Quick Answers</LABEL><BR><INPUT
name="sbo" id="sb_fm" type="radio" value="fm"><LABEL
for="sb_fm">Messages</LABEL><BR><INPUT name="sbo" id="sb_ctlk" type="radio"
value="ctlk"><LABEL for="sb_ctlk">Product
Catalog</LABEL><BR></DIV></DIV></FORM></DIV></TD></TR></TBODY></TABLE>
<DIV class="sub-headerbar-divider"></DIV></DIV>
<DIV class="container-content-wrap fixed" id="A">
<DIV class="container-content" itemtype="http://schema.org/Article"
itemscope="">
<DIV class="clearfix">
<DIV class="float-left container-breadcrumb">
<DIV><A
href="http://www.codeproject.com/script/Content/SiteMap.aspx">Articles</A> » <A
href="http://www.codeproject.com/Chapters/8/Platforms-Frameworks-Libraries.aspx">Platforms,
Frameworks & Libraries</A> » <A href="http://www.codeproject.com/KB/library/"><SPAN
itemprop="articleSection">Libraries</SPAN></A> » <A href="http://www.codeproject.com/KB/library/#General">General</A></DIV></DIV>
<DIV class="align-left float-right padded-top"> </DIV>
<DIV class="float-right container-breadcrumb article-nav">
<DIV><A title="Next" id="ctl00_PrevNext_NextLink" style="margin-left: 5px;"
href="http://www.codeproject.com/script/Articles/PrevNextLookup.aspx?aid=61629&at=1&secId=119">Next</A>
<IMG title="Next" id="ctl00_PrevNext_NextImg" style="border-width: 0px; vertical-align: bottom;"
src="AutoMapper-CodeProject_files/arrow-right.png" rel="nofollow"> </DIV></DIV>
<DIV class="align-right float-left"></DIV></DIV>
<TABLE class="extended container-article-parts" cellspacing="0"
cellpadding="0"><TBODY>
<TR valign="top">
<TD>
<DIV class="container-article-tabs" id="ctl00_Nav">
<DIV class="tabs">
<DIV>
<DIV class="selected">Article</DIV>
<DIV class="unselected"><A href="http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=61629">Browse
Code <IMG style="width: 18px; height: 18px; vertical-align: middle;" alt="Workspaces"
src="AutoMapper-CodeProject_files/git-icon.png"></A></DIV>
<DIV class="unselected"><A href="http://www.codeproject.com/script/Articles/ViewTasks.aspx?aid=61629">Bugs
/ Suggestions</A></DIV>
<DIV class="unselected"><A href="http://www.codeproject.com/script/Articles/Statistics.aspx?aid=61629">Stats</A></DIV>
<DIV class="unselected"><A href="http://www.codeproject.com/script/Articles/ListVersions.aspx?aid=61629">Revisions
(12)</A></DIV>
<DIV class="unselected"><A href="http://www.codeproject.com/script/Articles/ListAlternatives.aspx?aid=61629">Alternatives</A></DIV><!-- anchorLink used to auto-link to comments at end of article -->
<DIV class="unselected"><A class="anchorLink" id="ctl00_ArticleTabs_CommentLink"
href="http://www.codeproject.com/Articles/61629/WebControls/#_comments">Comments
<SPAN id="ctl00_ArticleTabs_CmtCnt">(32)</SPAN></A> </DIV>
<DIV class="related-link-box padded-top unselected" id="ctl00_ArticleTabs_WorkspaceLinks">
<DIV><A class="offblack bold" id="ctl00_ArticleTabs_WorkspaceLink" href="https://workspaces.codeproject.com/andriybuday/automapper">View
this article's Workspace</A></DIV>
<DIV><A id="ctl00_ArticleTabs_WorkspaceFork" href="https://workspaces.codeproject.com/andriybuday/automapper/fork">Fork
this Workspace</A></DIV></DIV></DIV></DIV>
<DIV>
<DIV class="social-bookmarks">
<H3>Share</H3>
<DIV class="popup-bar">
<DIV class="linkedin-icon"></DIV>
<DIV class="popup-bar-flyout"><SPAN class="linkedin">
<SCRIPT src="AutoMapper-CodeProject_files/in.js" type="text/javascript">
lang: en_US
</SCRIPT>
<SCRIPT type="IN/Share" data-showzero="true" data-counter="right"></SCRIPT>
</SPAN> </DIV></DIV>
<DIV class="popup-bar">
<DIV class="google-icon"></DIV>
<DIV class="popup-bar-flyout"><SPAN class="google">
<DIV class="g-plusone" data-size="medium"></DIV></SPAN> </DIV></DIV>
<DIV class="popup-bar">
<DIV class="facebook-icon"></DIV>
<DIV class="popup-bar-flyout"><SPAN class="facebook" id="fb-wrap" style="overflow: hidden;">
<DIV id="fb-root"></DIV>
<DIV class="fb-like" data-font="segoe ui" data-show-faces="false"
data-width="450" data-layout="button_count" data-send="false" data-href="http://www.codeproject.com/Articles/61629/AutoMapper"></DIV></SPAN>
</DIV></DIV>
<DIV class="popup-bar">
<DIV class="twitter-icon"></DIV>
<DIV class="popup-bar-flyout"><SPAN class="twitter"><A class="twitter-share-button"
href="https://twitter.com/share" data-hashtags="CodeProject"></A></SPAN>
</DIV></DIV></DIV></DIV></DIV></TD>
<TD>
<DIV class="container-article fixed" id="AT">
<DIV class="article">
<FORM name="aspnetForm" id="aspnetForm" style="margin: 0px; padding: 0px;"
action="/Articles/61629/AutoMapper" method="post">
<DIV><INPUT name="__VIEWSTATE" id="__VIEWSTATE" type="hidden" value="MOwK2k9GuaafgXlYS/x/34MXMju/YiLlHeKWsbRpWLM09unT3WS4K66bjETf/JzCBIgokshpUFo2XRYbjhpWZ75TnjExazkRW+zanc9dBRLWEcuWgmGJdhu7PrAyOD8cT5vDdBfASDwTHsK8FXIfdiFPm78dDRKo1FTH4KYaiQF1oFqZ3eSyK9NoiS4u+S5zu4Jfe4AOyXlQz5Dy3JAJksW/XPKJjdHSfywjTUMcrdEuUuDXc5mKnxKTh5pNsjPLzS14XmGB9wlDa8pjp0roAP39fIkVN0M8Trp74X5E3DeRQ0s82qBqbn+xPo0ynasOducLZEUhkrW5VlkmJxtPHdSXuCysvxJnfGHMptOsH1LLqczvMrh/RlK/eRvkfEda5+N1+8YV43V0QfXVABsvPEa/G8uljpd6GpWJgJklspfLPrvTzy7ZZWekUqy9pymjFYhtAtN+w7bevNi2FP1Qgec5u/DP3ynTVdkC++tH/sBfRHxhS0isD8ymrDrSk+BiwyqfmURIBF+uZcV+Byl7b1UD8pbkdVM4c/C2W/rYjjw+5RQ7vqGz4dUyn3eF7yVywvO68LltoE8NwnUskgu436uUsXn13btL9ecKoBXWlDUeioclnbSvTQK1gL4qD+ogRXFCYsHG8cVz0N6cUARCCiISoG77NSRt3lpCY/Cx8w4k3IrSHsqlj5sYAuEBHeCgwQuq9h9q2GODRpDrZACP36p+pDsnBh1XV+hq7BEAnwhLpNuzdkqwCs49I9SkJ+ryiBWta/9h2QxrL3M4HrZm0otnPiYBE6QwPvR/kb/N1HpM7CagUFBK64FiiI1QloxQ9x/tB5alL4rAAnhQPNeYXDFTCBGKzU7yw4sALBTinqSRju4ek4Mv1IyeWYZMMi2pKvf7R1iLneilmXbD0tAP+sas8J7U+UP5NNd1YxPyKYAHR3asV0hlbvXlWW+TjlXo8BdQPURqRgx5SzZ6xiB6SBXAK4NAC0qIgqMuaZt6EBY/G3TW9R31PopnTgMR9wbl2heeWj5hsuul3m7vbHSuo7PeosH+0OrvOktht1/XGjuZMMkOI8NeVEr2hJTtpd4nraAgQXDQxNb+6zbUOK9ilLc1zY6BW5SUJ+GieqJ3M5uX+Olu7w2e/cskj4waYd/DPEgiMcG6ba+qHcCSSbz4a/yWX9a43ON2TJNSMjFLumQjtvMsv8stTlKAhKl56fs7GwNkvkmsEgOHD7BOiN9bxQIaD0Zv2DdNSxkOSEJ4lulI0CUWS40iFSxs3Zbbk6s1Iq1DcX6G4nF+aNLO/WTXE94RY5+cKB2WTeSEEOtUVOFDwUaUwu/WEvjcDeckFoMZZhRDZeNJbx/zaGa0dey8h1/wEcYPSP/CLviqY/ynwBhrt2ybXB0tN1nmP7qwFFba+48JGqSq0KKutWfb75k869+cDinqTA3ulfPmcuhecuz4VVHCu7r3uEN0T8oIzqBug5kbI9O42n2qBzTBPU1KfinnjL18kny6Bid5XpMJODXryGQgcDMBpKcJG5si8EshIUbvhB7F9QaFkNaVT7ZwlzKmH0cuSVIXkowDbvvy8/3HavBtCZktiDwTkauqubCa0ZMRy9VI5kxTbE0pGJW4Rcoxcbe0jqWQKq3jExgYFsMxX2BqedbUIqSHU6SZgG0yoFtphAAvj/GfjiKoueC1BLiBfoGNUFu2FNrOk/wc9RfhVNZLd2gm5X2FkvXOC8exJeqD01nDEAQysp/dGSHKWLG3sQ9Wk6q3LdU1yFmtmQ2RdGTHUCJyli8g40h26kih5b/+cjrSaXMZBaRnJuAELCvgb1ej0P0BjNYPfmzwvG32dHHkl37NVhOxb0VivyZ7RGjl8vbTe49FEatTk7dp7Okwn9pZ74xY50qqKfo58Rw0KCJ3Q7uqWyqRQme87eQl/9qMWW2clIqKYFHJKKiJ01ri8Isj80nZmB9guJEYuPNxnHfddGOy9+EZ2GMk+vsKfOG/7gegP97avL7gQzYDpi/zE8R9b2OpjKTWwUwAN6L7Rh8QqFR/IldpvclN2j11FrV3xmFZd4L6CMD9yTukqPjahdOnTA/nIl2H3lCNajLJujl8gthHG0uG5ThgoUi9i8S5mmGbh7bvXpm0KZvT2jnIunkgL7OVS0jZtmBr3QRvNiaFRrznkMWhAda4oEIWYsLC8dLe/Tkl67kuvIjOGBGWuM0=">
</DIV>
<DIV class="header"><A name="Main"></A> <A name="_articleTop"
id="_articleTop"></A>
<DIV class="title">
<H1 id="ctl00_ArticleTitle" itemprop="name">AutoMapper</H1></DIV>
<DIV class="entry"> By <SPAN class="author"><A href="http://www.codeproject.com/script/Membership/View.aspx?mid=3999953"
rel="author"><SPAN itemtype="http://schema.org/Person" itemscope=""
itemprop="author"><SPAN itemprop="name">Andriy
Buday</SPAN></SPAN></A></SPAN>, <SPAN class="date" itemprop="dateModified"
content="2010-03-01 21:27:00"> 1 Mar 2010</SPAN>
</DIV>
<TABLE class="voting-bar">
<TBODY>
<TR>
<TD nowrap="nowrap">
<DIV class="tooltip anchorLink" id="ctl00_CurRat" style="cursor: pointer;"
name="CurRat_61629">
<TABLE class="small-text" cellspacing="0" cellpadding="0" itemtype="http://schema.org/AggregateRating"
itemscope="" itemprop="aggregateRating">
<TBODY>
<TR>
<TD class="nowrap">
<META content="5" itemprop="bestRating">
<META content="1" itemprop="worstRating"> <SPAN id="ctl00_ArticleRating_VI">
<DIV class="nowrap rating-stars-large" style="width: 119px; height: 21px; position: relative;">
<DIV class="clipped align-left float-left" style="width: 117px; height: 19px;"><IMG
style="border-width: 0px;" src="AutoMapper-CodeProject_files/stars-fill-lg.png">
</DIV>
<DIV class="clipped" style="width: 2px; height: 19px; position: relative;"><IMG
style="border-width: 0px; top: 0px; right: 0px; position: absolute;"
src="AutoMapper-CodeProject_files/stars-empty-lg.png">
</DIV></DIV></SPAN> </TD>
<TD class="nowrap" id="ctl00_ArticleRating_VR"> <SPAN
id="ctl00_ArticleRating_VotesR"> <SPAN class="rating"
itemprop="ratingValue">4.92</SPAN> (<SPAN class="count"
itemprop="ratingCount">77</SPAN> votes)</SPAN>
</TD></TR></TBODY></TABLE>
<DIV class="speech-bubble-container-up" id="ctl00_RB">
<DIV class="speech-bubble-up" style="width: 150px !important;">
<DIV>
<TABLE width="100%" height="50" title="Voting Distribution. Recent data only"
class="feature" cellspacing="0" cellpadding="0">
<TBODY>
<TR class="chart-row">
<TD title="Outside deviation limits - not included in score."
class="chart-column rating-ignore-vote"><IMG width="20"
height="1" title="" alt="" src="AutoMapper-CodeProject_files/t(1).gif"
border="0"><BR><SPAN title="0 votes">1</SPAN></TD>
<TD title="Outside deviation limits - not included in score."
class="chart-column rating-ignore-vote"><IMG width="20"
height="1" title="" alt="" src="AutoMapper-CodeProject_files/t(1).gif"
border="0"><BR><SPAN title="0 votes">2</SPAN></TD>
<TD title="Outside deviation limits - not included in score."
class="chart-column rating-ignore-vote"><IMG width="20"
height="1" title="1 vote, 1.3%" alt="1 vote, 1.3%" src="AutoMapper-CodeProject_files/pollcol.gif"
border="0"><BR><SPAN title="1 vote">3</SPAN></TD>
<TD class="chart-column"><IMG width="20" height="5" title="8 votes, 10.4%"
alt="8 votes, 10.4%" src="AutoMapper-CodeProject_files/pollcol.gif"
border="0"><BR><SPAN title="8 votes">4</SPAN></TD>
<TD class="chart-column"><IMG width="20" height="50" title="68 votes, 88.3%"
alt="68 votes, 88.3%" src="AutoMapper-CodeProject_files/pollcol.gif"
border="0"><BR><SPAN
title="68 votes">5</SPAN></TD></TR></TBODY></TABLE>
<DIV class="small-text align-center">4.92/5 - 77 votes</DIV>
<DIV class="small-text align-center subdue">1 removed</DIV>
<DIV class="small-text align-center subdue">μ 4.86, σ<SUB>a</SUB>
0.96 [<A href="http://www.codeproject.com/KB/FAQs/RatingReputationFAQ.aspx#noisefilter">?</A>]</DIV></DIV></DIV>
<DIV class="speech-bubble-pointer-up">
<DIV
class="speech-bubble-pointer-up-inner"></DIV></DIV></DIV></DIV></TD>
<TD nowrap=""></TD>
<TD class="voting-bar" id="ctl00_RateArticleRow">
<DIV class="float-right align-right">
<DIV class="container-rating small-text" id="ctl00_RateArticle_RateItemWrapper"
name="RateItem_61629">
<TABLE width="100%" class="small-text" cellspacing="0" cellpadding="0">
<TBODY>
<TR>
<TD class="rating-result align-right" id="ctl00_RateArticle_VoteResultDiv"><SPAN
class="align-right"></SPAN> <IMG width="16" height="16"
class="loaderImg" style="display: none;" alt="loading..." src="AutoMapper-CodeProject_files/animated_loading_blue.gif">
</TD>
<TD align="right" class="voteTbl"
style="white-space: nowrap;"><TABLE class="small-text">
<TBODY>
<TR>
<TD class="rating-prompt" id="ctl00_RateArticle_RateText">
Rate this: </TD>
<TD class="nowrap rating-stars-voter-large" id="ctl00_RateArticle_VoteFormDiv"><SPAN
class="tooltip ajaxHist radio voting" id="ctl00_RateArticle_RB"><SPAN
id="ctl00_RateArticle_VoteRBL"><INPUT name="ctl00$RateArticle$VoteRBL"
id="ctl00_RateArticle_VoteRBL_0" type="radio"
value="1"><INPUT name="ctl00$RateArticle$VoteRBL" id="ctl00_RateArticle_VoteRBL_1"
type="radio" value="2"><INPUT name="ctl00$RateArticle$VoteRBL"
id="ctl00_RateArticle_VoteRBL_2" type="radio"
value="3"><INPUT name="ctl00$RateArticle$VoteRBL" id="ctl00_RateArticle_VoteRBL_3"
type="radio" value="4"><INPUT name="ctl00$RateArticle$VoteRBL"
id="ctl00_RateArticle_VoteRBL_4" type="radio"
value="5"></SPAN> </SPAN> </TD>
<TD style="padding-left: 5px;"><INPUT name="ctl00$RateArticle$SubmitRateBtn" class="button" id="ctl00_RateArticle_SubmitRateBtn" type="submit" value="Vote!">
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<DIV class="hover-container">
<DIV class="rating-comment align-left float-right" id="ctl00_RateArticle_RSU">
<DIV class="padded"> Please <A id="ctl00_RateArticle_SignUp"
href="https://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fArticles%2f61629%2fAutoMapper">Sign
up or sign in</A> to vote.
</DIV></DIV></DIV></DIV></DIV></TD></TR></TBODY></TABLE></DIV>
<DIV class="text" id="contentdiv" itemprop="articleBody">
<UL class="download">
<LI><A href="http://www.codeproject.com/KB/library/AutoMapper/AutoMapperDemo.zip">Download
demo - 49.38 KB</A> </LI></UL>
<H2>Introduction</H2>
<P>AutoMapper is an object-to-object mapper, which allows you to solve
issues with mapping of the same properties in one object of one type to
another object of another type. For example, mapping a heavy entity
<CODE>Customer</CODE> object to the <CODE>CustomerDTO</CODE> could be done
with AutoMapper automatically.</P>
<H3>The Problem</H3>
<P>Have you ever had to write code like this:</P>
<PRE lang="cs">Customer customer = GetCustomerFromDB();
CustomerViewItem customerViewItem = <SPAN class="code-keyword">new</SPAN> CustomerViewItem()
{
FirstName = customer.FirstName,
LastName = customer.LastName,
DateOfBirth = customer.DateOfBirth,
NumberOfOrders = customer.NumberOfOrders
};
ShowCustomerInDataGrid(customerViewItem);</PRE>
<P>A sample scenario could be:</P>
<P>We have our domain model which has a <CODE>Customer</CODE> entity, and
we are going to show <CODE>Customer</CODE>s in a <CODE>DataGrid</CODE>,
and for that, we need a much lighter object <CODE>CustomerViewItem</CODE>,
a list of which is bound to a grid.</P>
<P>As you see, there are four lines of code which just copy the values
from one object to another. It could also be that you will need to show up
to 10-15 columns in your grid. What then?</P>
<P>Would you like to have something that will do mapping from
<CODE>Customer</CODE> to the <CODE>CustomerViewItem</CODE>
automatically?</P>
<P>Of course, you do, especially if you have another situation like
mapping of heavy data objects into DTO objects which are considered to be
sent though the wire.</P>
<H3>AutoMapper (The Solution)</H3>
<P>From the <A href="http://automapper.codeplex.com/">AutoMapper CodePlex
web page</A>, we can see that "AutoMapper is an object-object mapper.
Object-object mapping works by transforming an input object of one type
into an output object of a different type. What makes AutoMapper
interesting is that it provides some interesting conventions to take the
dirty work out of figuring out how to map type A to type B. As long as
type B follows AutoMapper's established conventions, almost zero
configuration is needed to map two types." So, in other words, it provides
the solution for our problem.</P>
<H2>Get Started</H2>
<P>To get started, go and download it <A href="http://automapper.codeplex.com/">here</A>.
It is a standalone assembly, so you should not have difficulties including
a reference to it in your project.</P>
<P>In order to ask AutoMapper to do the dirty work instead of me, we need
to add this line somewhere in the start of our code execution:</P>
<PRE lang="cs">Mapper.CreateMap<Customer, CustomerViewItem>();</PRE>
<P>Once we have that, we are done, and we can use this code to get our
mapped object:</P>
<PRE lang="cs">Customer customer = GetCustomerFromDB();
CustomerViewItem customerViewItem =
Mapper.Map<Customer, CustomerViewItem>(customer);
ShowCustomerInDataGrid(customerViewItem);</PRE>
<P>Let's take a look at the whole code base to see all about what I'm
going to talk further:</P>
<PRE lang="cs"><SPAN class="code-keyword">class</SPAN> Program
{
<SPAN class="code-keyword">static</SPAN> <SPAN class="code-keyword">void</SPAN> Main(<SPAN class="code-keyword">string</SPAN>[] args)
{
<SPAN class="code-keyword">var</SPAN> program = <SPAN class="code-keyword">new</SPAN> Program();
Mapper.CreateMap<Customer, CustomerViewItem>();
program.Run();
}
<SPAN class="code-keyword">private</SPAN> <SPAN class="code-keyword">void</SPAN> Run()
{
Customer customer = GetCustomerFromDB();
CustomerViewItem customerViewItem =
Mapper.Map<Customer, CustomerViewItem>(customer);
ShowCustomerInDataGrid(customerViewItem);
}
<SPAN class="code-keyword">private</SPAN> <SPAN class="code-keyword">void</SPAN> ShowCustomerInDataGrid(
CustomerViewItem customerViewItem){}
<SPAN class="code-keyword">private</SPAN> Customer GetCustomerFromDB()
{
<SPAN class="code-keyword">return</SPAN> <SPAN class="code-keyword">new</SPAN> Customer()
{
DateOfBirth = <SPAN class="code-keyword">new</SPAN> DateTime(<SPAN class="code-digit">1987</SPAN>, <SPAN class="code-digit">11</SPAN>, <SPAN class="code-digit">2</SPAN>),
FirstName = <SPAN class="code-string">"</SPAN><SPAN class="code-string">Andriy"</SPAN>,
LastName = <SPAN class="code-string">"</SPAN><SPAN class="code-string">Buday"</SPAN>,
NumberOfOrders = <SPAN class="code-digit">7</SPAN>
};
}
}
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">class</SPAN> Customer
{
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">string</SPAN> FirstName { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">string</SPAN> LastName { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
<SPAN class="code-keyword">public</SPAN> DateTime DateOfBirth { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">int</SPAN> NumberOfOrders { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
}
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">class</SPAN> CustomerViewItem
{
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">string</SPAN> FirstName { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">string</SPAN> LastName { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
<SPAN class="code-keyword">public</SPAN> DateTime DateOfBirth { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">int</SPAN> NumberOfOrders { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
}</PRE>
<P>And to prove that all values have been mapped, take a look at this
picture:</P><IMG width="600" height="362" src="AutoMapper-CodeProject_files/CustomerToViewCustomer_1.png"
complete="true">
<H3>More Complex Example 1 (Custom Map)</H3>
<P>So far, we know all about doing an extremely simple mapping. But, what
if we need something more complex, for example,
<CODE>CustomerViewItem</CODE> should have <CODE>FullName</CODE>, which
consists of the first and last names of <CODE>Customer</CODE>?</P>
<P>After I added <CODE lang="cs">public string FullName { get; set;
}</CODE> to <CODE>CustomerViewItem</CODE> and run my application in Debug
mode, I got a <CODE lang="cs">null</CODE> in the property. That is fine,
and is because AutoMapper doesn't see any <CODE>FullName</CODE> property
in the <CODE>Customer</CODE> class. In order to "open its eyes", all you
need to do is to change our <CODE>CreateMap</CODE> process a bit:</P>
<PRE lang="cs">Mapper.CreateMap<Customer, CustomerViewItem>()
.ForMember(cv => cv.FullName, m => m.MapFrom(
s => s.FirstName + <SPAN class="code-string">"</SPAN><SPAN class="code-string"> "</SPAN> + s.LastName))</PRE>
<P>And results are obtained immediately:</P><IMG width="400" height="107"
src="AutoMapper-CodeProject_files/CustomerToViewCustomer_2.png" complete="true">
<H3>More Complex Example 2 (Flattening)</H3>
<P>What if you have a property <CODE>Company</CODE> of type
<CODE>Company</CODE>:</P>
<PRE lang="cs"><SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">class</SPAN> Customer
{
<SPAN class="code-keyword">public</SPAN> Company Company { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
<SPAN class="code-comment">//</SPAN><SPAN class="code-comment">...
</SPAN>}
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">class</SPAN> Company
{
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">string</SPAN> Name { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
}</PRE>
<P>and want to map it into <CODE>CompanyName</CODE> of the view class:</P>
<PRE lang="cs"><SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">class</SPAN> CustomerViewItem
{
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">string</SPAN> CompanyName { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
<SPAN class="code-comment">//</SPAN><SPAN class="code-comment">...
</SPAN>}</PRE>
<P>What do you need to change in your mapping to make this work?</P>
<P>Answer: <STRONG>Nothing</STRONG>. AutoMapper goes in to the depth of
your classes, and if names match, it will do the mapping for you.</P>
<H3>More Complex Example 3 (Custom Type Resolvers)</H3>
<P>What if you have a boolean property <CODE>VIP</CODE> in your
<CODE>Customer</CODE> class?</P>
<PRE lang="cs"><SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">class</SPAN> Customer
{
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">bool</SPAN> VIP { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
}</PRE>
<P>and want to map it into a string <CODE>VIP</CODE> and represented like
"Y" or "N" instead?</P>
<PRE lang="cs"><SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">class</SPAN> CustomerViewItem
{
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">string</SPAN> VIP { <SPAN class="code-keyword">get</SPAN>; <SPAN class="code-keyword">set</SPAN>; }
}</PRE>
<P>Well, we can solve this the same way we did for <CODE>FullName</CODE>,
but a more appropriate way is to use custom resolvers. So, let's create a
customer resolver which will resolve the VIP issue for us.</P>
<P>It looks like:</P>
<PRE lang="cs"><SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">class</SPAN> VIPResolver : ValueResolver<<SPAN class="code-keyword">bool</SPAN>, <SPAN class="code-keyword">string</SPAN>>
{
<SPAN class="code-keyword">protected</SPAN> <SPAN class="code-keyword">override</SPAN> <SPAN class="code-keyword">string</SPAN> ResolveCore(<SPAN class="code-keyword">bool</SPAN> source)
{
<SPAN class="code-keyword">return</SPAN> source ? <SPAN class="code-string">"</SPAN><SPAN class="code-string">Y"</SPAN> : <SPAN class="code-string">"</SPAN><SPAN class="code-string">N"</SPAN>;
}
}</PRE>
<P>And, only one line is needed for our <CODE>CreateMap</CODE>
process:</P>
<PRE lang="cs">.ForMember(cv => cv.VIP, m => m.ResolveUsing<VIPResolver>().FromMember(x => x.VIP));</PRE>
<H3>More Complex Example 4 (Custom Formatters)</H3>
<P>What if I want AutoMapper to use my custom formatting of
<CODE>DateTime</CODE> instead of just using <CODE>ToString</CODE>, when it
does a mapping from a <CODE>DateTime</CODE> to a <CODE>String</CODE>
property? Let's say, I want to use the <CODE>ToLongDateString</CODE>
method to show the birth date in a different fashion.</P>
<P>For that, we add:</P>
<PRE lang="cs"><SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">class</SPAN> DateFormatter:IValueFormatter
{
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">string</SPAN> FormatValue(ResolutionContext context)
{
<SPAN class="code-keyword">return</SPAN> ((DateTime) context.SourceValue).ToLongDateString();
}
}</PRE>
<P>And make sure that AutoMapper knows where to use it:</P>
<PRE lang="cs">.ForMember(cv => cv.DateOfBirth, m => m.AddFormatter<DateFormatter>());</PRE>
<P>So now, I've got:</P><IMG width="600" height="207" src="AutoMapper-CodeProject_files/CustomerToViewCustomer_3.png"
complete="true">
<P>Great, isn't it? <CODE>BirthDate</CODE> is even shown in my native
language.</P>
<H3>Performance Question</H3>
<P>After I posted this article, one guy was really concerned about the
performance of AutoMapper. So, I have decided to measure execution time of
the AutoMapper mapping and manual mapping code.</P>
<P>First of all, I have code which returns me 100000 almost random
<CODE>Customer</CODE>s which goes to the <CODE>customers</CODE> list.</P>
<H4>Measurement of AutoMapper mapping time:</H4>
<PRE lang="cs">stopwatch.Start();
<SPAN class="code-keyword">var</SPAN> autoMapperCVI = <SPAN class="code-keyword">new</SPAN> List<customerviewitem>();
<SPAN class="code-keyword">foreach</SPAN> (<SPAN class="code-keyword">var</SPAN> customer <SPAN class="code-keyword">in</SPAN> customers)
{
autoMapperCVI.Add(Mapper.Map<customer,customerviewitem>(customer));
}
stopwatch.Stop();
Console.WriteLine(<SPAN class="code-keyword">string</SPAN>.Format(<SPAN class="code-string">"</SPAN><SPAN class="code-string">AutoMapper: {0}"</SPAN>, stopwatch.ElapsedMilliseconds));</PRE>
<H4>Measurement of the manual mapping time:</H4>
<PRE lang="cs">stopwatch.Start();
<SPAN class="code-keyword">var</SPAN> manualCVI = <SPAN class="code-keyword">new</SPAN> List<customerviewitem>();
<SPAN class="code-keyword">foreach</SPAN> (<SPAN class="code-keyword">var</SPAN> customer <SPAN class="code-keyword">in</SPAN> customers)
{
<SPAN class="code-keyword">var</SPAN> customerViewItem = <SPAN class="code-keyword">new</SPAN> CustomerViewItem()
{
FirstName = customer.FirstName,
LastName = customer.LastName,
FullName = customer.LastName + <SPAN class="code-string">"</SPAN><SPAN class="code-string"> "</SPAN> + customer.FirstName,
DateOfBirth = customer.DateOfBirth.ToLongDateString(),
CompanyName = customer.Company.Name,
NumberOfOrders = customer.NumberOfOrders,
VIP = customer.VIP ? <SPAN class="code-string">"</SPAN><SPAN class="code-string">Y"</SPAN> : <SPAN class="code-string">"</SPAN><SPAN class="code-string">N"</SPAN>
};
manualCVI.Add(customerViewItem);
}
stopwatch.Stop();
Console.WriteLine(<SPAN class="code-keyword">string</SPAN>.Format(<SPAN class="code-string">"</SPAN><SPAN class="code-string">Manual Mapping: {0}"</SPAN>, stopwatch.ElapsedMilliseconds));</PRE>
<P>I ran my tests many times and one of the possible outputs could be:</P>
<PRE lang="text">AutoMapper: 2117
Manual Mapping: 293</PRE>
<P>It looks like manual mapping is 7 times faster than automatic. But hey,
it took 2 secs to map hundred thousands of customers.</P>
<P>It is one of the situations where you should decide if the performance
is so critical for you or no. I don't think that there are a lot of cases
when you really need to choose manual mapping exactly because of
performance issue.</P>
<H2>Points of Interest</H2>
<P>I hope my article was interesting to read and that it gave you ideas
for how you can utilize this new feature called "AutoMapper".</P>
<P>Go to the <A title="AutoMapper" href="http://www.codeplex.com/AutoMapper">AutoMapper</A>
website for more information.</P></DIV>
<H2>License</H2>
<DIV id="LicenseTerms">
<P>This article, along with any associated source code and files, is
licensed under <A href="http://www.codeproject.com/info/cpol10.aspx" rel="license">The
Code Project Open License (CPOL)</A></P></DIV>
<DIV class="float-right" style="margin: 20px 0px 0px; border: 1px solid rgb(204, 204, 204); border-image: none;">
<DIV class="msg-300x250" data-tags="C#, .NET, Dev, Intermediate,rating4.5"
data-zone="ros" data-publisher="lqm.codeproject.site" data-type="ad"
data-format="300x250" data-loadonview="true"></DIV></DIV>
<H2 id="ctl00_AboutHeading">About the Author</H2>
<DIV class="container">
<DIV style="width: 210px; text-align: center; overflow: hidden; float: left;"><IMG
class="profile-pic" id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberPhoto"
style="border-width: 0px; transform: rotate(-1deg);" src="AutoMapper-CodeProject_files/%7B33ca1857-a266-4a92-ae19-a2666149416b%7D.jpg">
</DIV>
<DIV class="container-member float-left" style="width: 235px;"><B><A
class="author" id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberProfileLink"
href="http://www.codeproject.com/Members/andriybuday">Andriy Buday</A></B>
<DIV class="company"><SPAN id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberJobTitle">Software
Developer</SPAN> <SPAN id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberCompany">SoftServe</SPAN>
<BR><SPAN
id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberLocation">Ukraine <IMG
width="16" height="11" alt="Ukraine" src="AutoMapper-CodeProject_files/UA.gif"></SPAN>
</DIV></DIV>
<DIV class="padded-top float-left clearfix" style="width: 600px;"> I'm
very pragmatic and self-improving person. My goal is to become successful
community developer.<BR>I'm young and love learning, these are
precondition to my success.<BR> <BR>Currently I'm working in
dedicated Ukrainian outsourcing company SoftServe as .NET developer on
enterprise project. In everyday work I'm interacting with lot of
technologies which are close to .NET (NHibernate, UnitTesting,
StructureMap, WCF, Win/WebServices, and so on...)<BR> <BR>Feel free
to contact me. </DIV></DIV><BR>
<DIV class="clearfix"></DIV>
<DIV style="padding-top: 8px;"><A class="anchorLink" href="http://www.codeproject.com/Articles/61629/AutoMapper#_articleTop">Article
Top</A> </DIV>
<DIV class="sticky-stop" style="margin: 10px auto auto; height: 90px;">
<DIV class="msg-728x90" data-tags="C#, .NET, Dev, Intermediate,pos_bottom"
data-zone="bottom" data-publisher="lqm.codeproject.site" data-type="ad"
data-format="728x90" data-loadonview="true"></DIV></DIV></FORM></DIV>
<H2>Comments and Discussions</H2><A name="_comments" class="float-left"
id="_comments"> </A>
<DIV id="_MessageBoardctl00_MessageBoard" onclick="return SwitchMessage(event, null)">
<TABLE class="forum relaxed" id="ForumTable" cellspacing="0" cellpadding="0">
<TBODY>
<TR>
<TD class="header1 callout"><B>You must <A href="https://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fArticles%2f61629%2fAutoMapper%3ffid%3d1562409">Sign
In</A> to use this message board.</B></TD></TR>
<TR>
<TD>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="3">
<TBODY>
<TR class="header1">
<TD style="white-space: nowrap;" colspan="2">
<DIV class="container">
<DIV class="float-right">
<FORM class="searchbar" action="/Search.aspx?fid=0" method="get"><INPUT name="fid" type="hidden" value="1562409"><B>Search
this forum
</B><INPUT name="qf" class="search" type="search"> <INPUT class="button" type="submit" value="Go">
</FORM></DIV></DIV></TD>
<TR class="header2">
<TD></TD>
<TD style="width: 100%;">
<DIV style="text-align: right;">
<FORM style="margin: 0px; padding: 0px;" action="/script/Forums/SetOptions.aspx?floc=%2fArticles%2f61629%2fAutoMapper&fid=1562409"
method="get"><INPUT name="fid" type="hidden" value="1562409"><INPUT name="currentQS" type="hidden" value="?floc=%2fArticles%2f61629%2fAutoMapper&fid=1562409"><INPUT name="floc" type="hidden" value="/Articles/61629/AutoMapper"><INPUT
name="prof" id="prof" style="vertical-align: middle;" type="checkbox"
checked="checked"><LABEL for="prof">Profile
popups</LABEL> Spacing<SELECT name="spc"
class="dropdown" size="1"><OPTION value="Relaxed" selected="">Relaxed</OPTION><OPTION
value="Compact">Compact</OPTION><OPTION
value="Tight">Tight</OPTION>
</SELECT> Noise<SELECT name="noise" class="dropdown"
size="1"><OPTION value="1">Very High</OPTION><OPTION value="2">High</OPTION><OPTION
value="3" selected="">Medium</OPTION><OPTION
value="4">Low</OPTION><OPTION value="5">Very Low</OPTION>
</SELECT> Layout<SELECT name="view" class="dropdown"
size="1"><OPTION value="Normal"
selected="">Normal</OPTION><OPTION value="Topic">Open
Topics</OPTION><OPTION value="Expanded">Open
All</OPTION><OPTION value="Thread">Thread View</OPTION>
</SELECT> Per page<SELECT name="mpp"
class="dropdown" size="1"><OPTION
value="10">10</OPTION><OPTION value="25">25</OPTION><OPTION
value="50" selected="">50</OPTION>
</SELECT> <INPUT name="SetOpt" class="button" type="submit" value="Update">
</FORM></DIV></TD></TR></TBODY></TABLE></TD>
<TR>
<TD><A name="xx0xx"></A>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="2">
<TBODY>
<TR class="navbar">
<TD></TD>
<TD style="width: 50%; text-align: right;"></TD>
<TD style="text-align: right; white-space: nowrap;"><SPAN
class="nav-link disabled">First</SPAN> <SPAN class="nav-link disabled">Prev</SPAN>
<SPAN
class="nav-link disabled">Next</SPAN></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE width="100%" class="fixed-layout blank-background" border="0"
cellspacing="0" cellpadding="0">
<TBODY>
<TR>
<TD><IMG width="1" height="5" alt="" src="AutoMapper-CodeProject_files/t(2).gif"
border="0"></TD></TR>
<TR class="header hover-row root" id="F4808355_h0">
<TD width="100%" class="subject-line normal ">
<TABLE width="100%" border="0" cellspacing="0"
cellpadding="0">
<TBODY>
<TR>
<TD width="20" class="indent"><A
name="xx4808355xx"></A><IMG width="16" height="16"
align="top" alt="General" src="AutoMapper-CodeProject_files/msg_general.gif"></TD>
<TD class="subject hover-container"><A name="4808355"
class="message-link" href="http://www.codeproject.com/Messages/4808355/Great-article.aspx"
thread="4808355" parent="0">Great article</A> <A title="Click to pin message"
onclick="return Pin(this);" href="http://www.codeproject.com/Articles/61629/AutoMapper#"><IMG
width="13" height="13" align="top" alt="Pin" src="AutoMapper-CodeProject_files/pin.png"
border="0"></A></TD>
<TD class="icon"><IMG height="16" title="member" alt="member"
src="AutoMapper-CodeProject_files/icn-member-16.gif"
border="0"></TD>
<TD class="author"><A href="http://www.codeproject.com/script/Membership/View.aspx?mid=7435427">tramminhtri</A></TD>
<TD class="date">26-Apr-14
19:42 </TD></TR></TBODY></TABLE></TD></TR>
<TR class="content root selected" id="F4808355_h1" style="display: none;">
<TD width="100%" class="normal">
<TABLE width="100%" border="0" cellspacing="0"
cellpadding="0">
<TBODY>
<TR valign="top">
<TD class="indent align-right" style="width: 20px;">
<DIV class="voteform vertical" votingtype="GoodOrBad"
msgid="4808355" ownerid="7435427"></DIV><IMG width="20"
height="1" alt="" src="AutoMapper-CodeProject_files/t(2).gif"></TD>
<TD class="text">
<TABLE width="100%" border="0" cellspacing="5"
cellpadding="0">
<TBODY>
<TR>
<TD>
<TABLE width="100%" border="0" cellspacing="0"
cellpadding="0">
<TBODY>
<TR>
<TD colspan="2">Thank you so much for your
sharing. Please keep it up.<BR></TD></TR>
<TR class="footer" style="vertical-align: top;">
<TD><A href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fArticles%2f61629%2fAutoMapper">Sign
In</A>·<WBR><A title="View Thread" href="http://www.codeproject.com/Articles/61629/AutoMapper?fid=1562409&tid=4808355">View Thread</A>·<WBR><A
title="Get permanent link" href="http://www.codeproject.com/Messages/4808355/Great-article.aspx">Permalink</A></TD>
<TD style="text-align: right;"><SPAN class="rating-label"
id="MVF4808355" style="white-space: nowrap;"
data-ref="3_4808355"></SPAN></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
<TR class="header hover-row root" id="F4674223_h0">
<TD width="100%" class="subject-line normal ">
<TABLE width="100%" border="0" cellspacing="0"
cellpadding="0">
<TBODY>
<TR>
<TD width="20" class="indent"><A
name="xx4674223xx"></A><IMG width="16" height="16"
align="top" alt="Question" src="AutoMapper-CodeProject_files/msg_question.gif"></TD>
<TD class="subject hover-container"><A name="4674223"
class="message-link" href="http://www.codeproject.com/Messages/4674223/Great-work.aspx"
thread="4674223" parent="0">Great work</A> <A title="Click to pin message"
onclick="return Pin(this);" href="http://www.codeproject.com/Articles/61629/AutoMapper#"><IMG
width="13" height="13" align="top" alt="Pin" src="AutoMapper-CodeProject_files/pin.png"
border="0"></A></TD>
<TD class="icon"><IMG height="16" title="member" alt="member"
src="AutoMapper-CodeProject_files/icn-member-16.gif"
border="0"></TD>
<TD class="author"><A href="http://www.codeproject.com/script/Membership/View.aspx?mid=8104718">MadhureshK</A></TD>