public async Task <IActionResult> Delete(string code) { try { if (string.IsNullOrWhiteSpace(code)) { return(this.BadRequestEx("code")); } await _fruitService.FruitDelete(code); return(this.NoContentEx()); } catch (Exception ex) { return(this.ErrorEx(ex.Message)); } }
public IActionResult Delete(string name) { try { if (string.IsNullOrWhiteSpace(name)) { return(this.BadRequestEx("name")); } _fruitService.FruitDelete(name); return(this.NoContentEx()); } catch (Exception ex) { return(this.ErrorEx(ex.Message)); } }