public HttpResponseMessage Put([FromBody] JObject jsonObject)
        {
            try
            {
                AdressManagementDetailDomainModel adressDomainModel =
                    jsonObject.ToObject <AdressManagementDetailDomainModel>();

                if (adressDomainModel == null)
                {
                    throw new Exception("Invalid JSON Object");
                }

                InsertAdressQuery query = new InsertAdressQuery()
                {
                    MandatorUIDs = RequestMandatorUIDs,
                    AdressManagementDetailDomainModel = adressDomainModel
                };

                InsertAdressQueryHandler handler = new InsertAdressQueryHandler(query, UnityContainer);

                return(Request.CreateResponse(HttpStatusCode.Accepted, handler.Handle()));
            }
            catch (Exception e)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, e));
            }
        }
Example #2
0
 public InsertAdressQueryHandler(InsertAdressQuery query, IUnityContainer unityContainer) : base(unityContainer)
 {
     _query = query;
     _uow   = new OrgManUnitOfWork();
 }