/// <summary> /// Inserts a new contact info into the DAL. /// </summary> /// <param name="data">DTO to create from</param> /// <returns>An ContactInfo DAL object</returns> /// <exception cref="System.ArgumentException">Errors in data will result in an exception being thrown</exception> public IContactInfo InsertContact(IContactInfo data) { var db = new Context(); var contactInfo = ContactInfo.CreateContactInfo(data); db.ContactInfoes.Add(contactInfo); db.SaveChanges(); return(contactInfo); }
public ContactInfo BuildInteface() { return(ContactInfo.CreateContactInfo(this.Id, this.Uid, this.FirstName, this.LastName, this.Title, this.DateCreated, this.City, this.CountryId, this.Addresses.Select(a_ => a_.BuildInteface()), this.PhoneNumbers.Select(pn_ => pn_.BuildInteface()), this.EmailAddresses.Select(e_ => e_.BuildInteface()))); }