public IActionResult ErrorAdd(Errors deneme) { // ObjectId verim = ObjectId.Parse(deneme._idString); // var categoryid = _categoryService.Get(deneme.Category_id); //deneme.Category_id = categoryid.Category_id; _errorService.Create(deneme); return(RedirectToAction("listeleverileri", "Home")); }
private void LogError(Exception ex) { try { ErrorModel ErrorModel = new ErrorModel(); ErrorService ErrorService = new ErrorService(); ErrorModel.CreatedDate = DateTime.Now; ErrorModel.Message = ex.Message; ErrorModel.StackTrace = ex.StackTrace; ErrorService.Create(ErrorModel); } catch { } }
private void LogError(Exception ex) { try { Error error = new Error(); error.CreatedDate = DateTime.Now; error.Message = ex.Message; error.StackTrace = ex.StackTrace; _errorService.Create(error); _errorService.Save(); } catch { } }
public HttpResponseMessage Create(HttpRequestMessage request, ErrorModel ErrorModel) { return(CreateHttpResponse(request, () => { var a = request.CreateResponse(HttpStatusCode.BadRequest, ModelState); HttpResponseMessage response = null; if (!ModelState.IsValid) { response = request.CreateResponse(HttpStatusCode.BadRequest, ModelState); } else { var ErrorService = new ErrorService(); ErrorService.Create(ErrorModel); //var responseData = true; response = request.CreateResponse(HttpStatusCode.OK); } return response; })); }