Пример #1
0
 public IHttpActionResult Post([FromBody] NOPVData data)
 {
     try
     {
         var newObject = _nopvData.SaveDetails(data);
         return(CreatedAtRoute("DefaultApi", new { id = newObject.BBL }, newObject));
     }
     catch (Exception e)
     {
         return(Content(HttpStatusCode.BadRequest, e.Message));
     }
 }
Пример #2
0
        /// <summary>
        /// Get NOPV details for given BBL.
        /// </summary>
        /// <param name="id">BBL</param>
        /// <returns></returns>
        public IHttpActionResult Get(string id)
        {
            _logger.Info(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, "Get called.");

            NOPVData data = _nopvData.GetDetails(id);

            if (data == null)
            {
                return(Content(HttpStatusCode.NotFound, "BBL not found"));
            }
            return(Ok(data));
        }