public IHttpActionResult Get() { var mng = new CellarManager(); apiResp.Data = mng.RetrieveAll(); return(Ok(apiResp)); }
public IHttpActionResult Post(Cellar cellar) { try { var mng = new CellarManager(); mng.Create(cellar); apiResp = new ApiResponse(); apiResp.Message = "Action was executed."; return(Ok(apiResp)); } catch (BussinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }
public IHttpActionResult Get(string id_Store) { try { var mng = new CellarManager(); var cellar = new Cellar { Id_Store = id_Store }; Cellar cellarObj = mng.RetrieveById(cellar); apiResp = new ApiResponse(); apiResp.Data = cellarObj; return(Ok(apiResp)); } catch (BussinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }