public async static Task Update(m.Subscription obj) { using (var db = DbAccess.ConnectionFactory()) { await db.ExecuteAsync(DbAccess.Update <m.Subscription>(), obj); } }
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)); } }
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)); } }