public IActionResult Insert(TargetAddDto model) { if (!ModelState.IsValid) { return(View(model)); } model.UserId = GetCurrentUser().Result.Id; model.LastModified = DateTime.Now; var obj = _mapper.Map <Target>(model); try { _targetService.Add(obj); _customLogger.Information("TargetController | Added New Target : " + obj.Name); return(RedirectToAction("Index")); } catch (Exception e) { _customLogger.Error("TargetController | Insert Target Error " + e.Message.ToString()); } return(View(model)); }