public async Task <IActionResult> Edit([Bind("WarehouseCode,WarehouseName,WarehouseDesc,CompanyCode,Id,Is_Active,Created_Date,Created_By,Updated_Date,Updated_By")] M_Warehouse m_Warehouse) { if (ModelState.IsValid) { m_Warehouse.Updated_By = await base.CurrentUserId(); ResultObject resultObj; try { using (var whBll = new WarehouseBLL()) { resultObj = await whBll.UpdateWarehouse(m_Warehouse); _cache.Remove("CACHE_MASTER_WAREHOUSE"); } return(Json(new { success = true, data = (M_Warehouse)resultObj.ObjectValue, message = "Warehouse Update." })); } catch (Exception ex) { return(Json(new { success = false, data = m_Warehouse, message = ex.Message })); } } var err = ModelState.Values.SelectMany(x => x.Errors).Select(x => x.ErrorMessage).ToList(); return(Json(new { success = false, errors = err, data = m_Warehouse, message = "Update Failed" })); }