Created
June 7, 2013 08:32
-
-
Save bitsprint/5727864 to your computer and use it in GitHub Desktop.
AutoMapper Domain To ViewModel Profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace Web.Profiles.DomainToViewModel | |
| { | |
| using System.Linq; | |
| using System.Reflection; | |
| using AutoMapper; | |
| using Core.Extensions; | |
| public partial class DomainToViewModel : Profile | |
| { | |
| public override string ProfileName | |
| { | |
| get { return this.GetType().Name; } | |
| } | |
| protected override void Configure() | |
| { | |
| this.GetType() | |
| .GetMethods(BindingFlags.NonPublic | BindingFlags.Instance) | |
| .Where(x => x.IsFamily && x.Name != "Configure" && x.Name.Contains("Configure")) | |
| .ForEach(method => method.Invoke(this, new object[] { })); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment