internal async Task <JsonResult> ItemCategoryDelete(itemCategorydeleteModel icdm) { SqlConnection cn = null; try { cn = Connection.GetConnection(); SqlCommand smd = new SqlCommand("[item_category_delete]", cn) { CommandType = CommandType.StoredProcedure }; smd.Parameters.AddWithValue("@id", icdm.Id); smd.Parameters.Add("@jsonOutput", SqlDbType.NVarChar, -1).Direction = ParameterDirection.Output; // Execute the command await smd.ExecuteNonQueryAsync().ConfigureAwait(false); // Get the values string json = smd.Parameters["@jsonOutput"].Value.ToString(); smd.Dispose(); JArray arr = JArray.Parse(json); return(new JsonResult(arr)); } catch (Exception) { throw; } finally { Connection.CloseConnection(ref cn); } }
public async Task <JsonResult> ItemCategoryDelete([FromBody] itemCategorydeleteModel icdm) { try { return(await _itemLogic.ItemCategoryDelete(icdm).ConfigureAwait(false)); } catch (Exception ee) { return(await _itemLogic.SendRespose("False", ee.Message).ConfigureAwait(false)); } }