コード例 #1
0
        public async Task <IActionResult> Post([FromBody] Slot_model_utenti body)
        {
            await Db.Connection.OpenAsync();

            body.Db = Db;
            await body.InsertAsync();

            return(new OkObjectResult(body));
        }
コード例 #2
0
        public async Task <IActionResult> PutOne(int id, [FromBody] Slot_model_utenti body)
        {
            await Db.Connection.OpenAsync();

            var query  = new SlotQuery(Db);
            var result = await query.FindOneAsync(id);

            if (result is null)
            {
                return(new NotFoundResult());
            }
            result.name   = body.name;
            result.e_mail = body.e_mail;
            await result.UpdateAsync();

            return(new OkObjectResult(result));
        }