public async Task <ActionResult> Create([Bind(Include = _bindAll)] ExpenseModel expense) { if (ModelState.IsValid) { await _service.Add(expense); return(RedirectToAction("Index")); } return(View(expense)); }
public Result Add(Expenses Expenses) { var result = new Result(); try { ExpensesService ExpensesService = new ExpensesService(); ExpensesService.Add(Expenses); result.IsSuccess = true; } catch (Exception exception) { result.IsSuccess = false; result.ExceptionInfo = exception; } return(result); }