Skip to content

Instantly share code, notes, and snippets.

@amoerie
Created December 22, 2012 14:59
Show Gist options
  • Save amoerie/4359219 to your computer and use it in GitHub Desktop.
Save amoerie/4359219 to your computer and use it in GitHub Desktop.
public class PersonFormDto: IDto<Person>
{
public int Id { get; set; }
[Required(ErrorMessage = "Hey why don't you tell me who you are?!")]
public string Name { get; set; }
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
[Required(ErrorMessage = "Come on now, don't be shy.")]
public DateTime Birthday { get; set; }
public AddressFormDto Address { get; set; }
}
public class AddressFormDto: IDto<Address>
{
public int Id { get; set; }
[Display(Name = "Street")]
[Required(ErrorMessage = "You don't have a street?")]
public string Street { get; set; }
[Display(Name = "House Nr.")]
[Required(ErrorMessage = "What's your house number?")]
public string HouseNumber { get; set; }
[Display(Name = "Postal code")]
[Required(ErrorMessage = "Ahum")]
public string PostalCode { get; set; }
[Display(Name = "City")]
[Required(ErrorMessage = "Hey don't forget to fill in your city")]
public string City { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment