コード例 #1
0
 public async static Task Update(m.Subscription obj)
 {
     using (var db = DbAccess.ConnectionFactory())
     {
         await db.ExecuteAsync(DbAccess.Update <m.Subscription>(), obj);
     }
 }
コード例 #2
0
        public async Task <IActionResult> Post([FromBody] m.Subscription data)
        {
            try
            {
                await d.Subscription.Insert(data);

                return(Ok(data));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
コード例 #3
0
        public async Task <IActionResult> Put(Guid id, [FromBody] m.Subscription data)
        {
            try
            {
                if (id != data.SubscriptionId)
                {
                    return(BadRequest());
                }

                await d.Subscription.Update(data);

                return(Ok(data));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }