public IActionResult CreateRecord([FromBody] Ledger aObject) { if (aObject == null) { return(BadRequest()); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } aObject.TransId = LedgerRepo.InsertToGetId(aObject); UpdateAmount(aObject); return(Ok(aObject)); }