public async Task <IActionResult> UpdatePinNumber([FromBody] Pin dt) { try { if (dt == null) { return(BadRequest(ModelState)); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var data = await _repository.ChangData(dt); return(Ok(data)); } catch (Exception e) { return(BadRequest()); throw e; } }
public IActionResult Post([FromBody] Pin dt) { try { if (dt == null) { return(BadRequest()); } if (!ModelState.IsValid) { return(BadRequest()); } return(Ok(repository.ChangData(dt))); } catch (Exception e) { return(BadRequest()); } }