public bool SaveVideoDetails(SaveVideoDetails video) { try { bool response = _repository.SaveVideoDetails(video); return(response); } catch (Exception) { throw; } }
public HttpResponseMessage SaveVideoDetails(SaveVideoDetails video) { try { bool response = false; if (_business.IsValidVideoTitle(video.title)) { response = _business.SaveVideoDetails(video); } else { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "A video with same title already exists")); } return(Request.CreateResponse(HttpStatusCode.OK, response)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message.ToString())); } }