public async Task <IHttpActionResult> PutIdentityUserClaim(Int32 id, IdentityUserClaimVm vm)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != vm.Id)
            {
                return(BadRequest());
            }

            var result = Task.Factory.StartNew(() => {
                IUnitOfWork uow = new UnitOfWorkImp(new IRepositoryConnection[] { IdentityUserClaimRepository });
                var bo          = (BOIdentityUserClaim)vm.BOIdentityUserClaim(IdentityUserClaimRepository);
                uow.Update(bo);

                string err;
                if (!uow.Commit(out err))
                {
                    var resp = new HttpResponseMessage(HttpStatusCode.BadRequest)
                    {
                        Content = new StringContent(err)
                    };
                    throw new HttpResponseException(resp);
                }
                return(true);
            });
            await result;

            if (!result.Result)
            {
                return(NotFound());
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> PutCustomerDemographics(string id, CustomerDemographicsVm vm)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != vm.CustomerTypeID)
            {
                return(BadRequest());
            }

            var result = Task.Factory.StartNew(() => {
                IUnitOfWork uow = new UnitOfWorkImp(new IRepositoryConnection[] { CustomerDemographicsRepository });
                var bo          = (BOCustomerDemographics)vm.BOCustomerDemographics(CustomerDemographicsRepository);
                uow.Update(bo);

                string err;
                if (!uow.Commit(out err))
                {
                    var resp = new HttpResponseMessage(HttpStatusCode.BadRequest)
                    {
                        Content = new StringContent(err)
                    };
                    throw new HttpResponseException(resp);
                }
                return(true);
            });
            await result;

            if (!result.Result)
            {
                return(NotFound());
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }