Skip to content

How to create Data Transfer Object Data Contract

marektihkan edited this page Sep 13, 2010 · 1 revision

Workflow

  1. Create class to DataContracts.(BoundedContext) namespace
  2. Add public properties
  3. Add [Serializable] attribute if needed

Example


namespace ExampleSolution.DataContracts
{
    [Serializable]
    public class PersonDataContract
    {
        public int Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string AddressLine1 { get; set; }
        public string AddressLine2 { get; set; }
        public string Zip { get; set; }
    }
}