コード例 #1
0
 /// <summary>
 /// Updates a Subscription record in the database
 /// </summary>
 /// <param name="record">Record to update</param>
 public async Task UpdateSubscriptionAsync(SubscriptionRecord record)
 {
     await OperationAsync(async ctx =>
     {
         var recordInDb = await ctx.FirstOrDefaultAsync <SubscriptionRecord>(
             "where [Id] = @0", record.Id);
         if (recordInDb == null)
         {
             return;
         }
         recordInDb.MergeChangesFrom(record);
         recordInDb.LastModifiedUtc = DateTimeOffset.UtcNow;
         await ctx.UpdateAsync(recordInDb);
     });
 }
コード例 #2
0
 /// <summary>
 /// Inserts a Subscription record into the database
 /// </summary>
 /// <param name="record">Record to insert</param>
 public async Task InsertSubscriptionAsync(SubscriptionRecord record)
 {
     await OperationAsync(ctx => ctx.InsertAsync(record));
 }