public async Task <IActionResult> Post([FromBody] PostConector body) { using (var db = new AppDb()) { await db.Connection.OpenAsync(); body.Db = db; var result = await body.ExcuteAsync(); return(new OkObjectResult(result)); } }
public async Task <IActionResult> GetNewsItem() { using (var db = new AppDb()) { await db.Connection.OpenAsync(); PostConector postConector = new PostConector(db); postConector.operationName = "NewsItemPost"; postConector.operateType = "SelectAll"; var result = await postConector.ExcuteAsync(); return(new OkObjectResult(result)); } }