Example #1
0
 public ContactWithAddressDto GetContactWithAddressDto(Guid id)
 {
     using (var context = new ContactAggregateContext()) {
         Contact c = context.Contacts.Find(id);
         return(ContactWithAddressDto.Create(c.Id, c.Name, c.PrimaryAddress, c.Source));
     }
 }
Example #2
0
 // GET api/<controller>/5
 public Address GetPrimaryAddressForContact(Guid id)
 {
     using (var context = new ContactAggregateContext()) {
         return(context.Contacts.Find(id).PrimaryAddress);
     }
 }
Example #3
0
 // GET api/<controller>
 public IEnumerable <Contact> Get()
 {
     using (var context = new ContactAggregateContext()) {
         return(context.Contacts.ToList());
     }
 }