public AddContactResponse Post_AddContact([FromBody] Models.Contact mContact) { IContactBS bs = DIFactoryDesigntime.GetInstance <IContactBS>(); IBaseConverter <Models.Contact, Entities.Contact> convtResult = new AutoMapConverter <Models.Contact, Entities.Contact>(); Entities.Contact eContact = convtResult.ConvertObject(mContact); bs.AddContact(eContact); var addContactResponse = new AddContactResponse() { ContactID = eContact.ContactID }; return(addContactResponse); }
public AddContactsResponse Post_AddContacts([FromBody] List <Models.Contact> mContactList) { var contactIdList = new List <int>(); IContactBS bs = DIFactoryDesigntime.GetInstance <IContactBS>(); foreach (var mContact in mContactList) { IBaseConverter <Models.Contact, Entities.Contact> convtResult = new AutoMapConverter <Models.Contact, Entities.Contact>(); Entities.Contact eContact = convtResult.ConvertObject(mContact); bs.AddContact(eContact); contactIdList.Add(eContact.ContactID); } var resp = new AddContactsResponse(); resp.ContactIdList = contactIdList; return(resp); }