public HttpResponseMessage Post([FromBody] Customers.Data.Model.Customer customer)
 {
     if (customer == null)
     {
         Logger.Log(LogType.Argument, string.Concat("Invalid Argument ", nameof(customer)));
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, new ArgumentException(nameof(customer))));
     }
     try
     {
         _custRepo.Add(customer);
         _custRepo.Save();
         return(Request.CreateResponse(HttpStatusCode.OK, customer));
     }
     catch (Exception ex)
     {
         Logger.Log(LogType.InvalidOperation, ex.Message, ex.StackTrace);
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, new InvalidOperationException(ex.Message, ex)));
     }
 }
        public HttpResponseMessage Put([FromUri] int id, [FromBody] Customers.Data.Model.Customer customer)
        {
            if (id <= 0)
            {
                Logger.Log(LogType.Argument, string.Concat("Invalid Argument ", nameof(id)));
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, new ArgumentException(nameof(id))));
            }
            if (customer == null)
            {
                Logger.Log(LogType.Argument, string.Concat("Invalid Argument ", nameof(id)));
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, new ArgumentException(nameof(customer))));
            }

            var cust = GetCustomer(id);

            if (cust == null)
            {
                Logger.Log(LogType.Argument, string.Concat("Null Reference ", nameof(cust)));
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, new NullReferenceException(nameof(cust))));
            }

            cust.FullName    = customer.FullName;
            cust.Age         = customer.Age;
            cust.DOB         = customer.DOB;
            cust.AddressList = customer.AddressList;
            try
            {
                _custRepo.Update(cust);
                _custRepo.Save();
                return(Request.CreateResponse(HttpStatusCode.OK, cust));
            }
            catch (Exception ex)
            {
                Logger.Log(LogType.InvalidOperation, ex.Message, ex.StackTrace);
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, new InvalidOperationException(ex.Message, ex)));
            }
        }