Skip to content

Instantly share code, notes, and snippets.

@tkellogg
Created September 16, 2011 03:05
Show Gist options
  • Save tkellogg/1221098 to your computer and use it in GitHub Desktop.
Save tkellogg/1221098 to your computer and use it in GitHub Desktop.
AutoMapper example for my blog (http://timkellogg.blogspot.com)
public class Account
{
public virtual int AccountId { get; set; }
[Matches(@"[A-Z]{2}\d{5}")]
public virtual string Code { get; set; }
[Required]
public virtual string Name { get; set; }
public virtual int? Age { get; set; }
}
public class AccountViewModel
{
public virtual int AccountId { get; set; }
public virtual string Code { get; set; }
public virtual string Name { get; set; }
public virtual int Age { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment