public IHttpActionResult AddCustomer(CustomerView objCustomerRec) { try { CustomerRecord objCustomerData = new CustomerRecord(); objCustomerRec.CopyProperties(objCustomerData); _CustomerService.Create(objCustomerData); if (objCustomerRec.FK_CommiteId > 0) { CommiteMember member = new CommiteMember(); member.FK_CommiteId = objCustomerRec.FK_CommiteId; member.FK_CustomerId = objCustomerData.Id; member.IsActive = true; member.CreatedDate = member.UpdatedDate = System.DateTime.Now; member.UpdatedBy = member.CreatedBy = objCustomerData.CreatedBy; _MemberService.Create(member); } return(Ok(objCustomerRec)); } catch (Exception ex) { throw ex; } }