コード例 #1
0
 public static async Task SaveIncompleteAsync(int certId)
 {
     using (var context = new NcmaContext())
     {
         membercert retCert = context.membercerts.FirstOrDefault(c => c.ID == certId);
         if (retCert != null)
         {
             retCert.Completed = false;
         }
         await context.SaveChangesAsync();
     }
 }
コード例 #2
0
        public static async Task SaveCompleteAsync(int certId, string batchId = null)
        {
            using (var context = new NcmaContext())
            {
                membercert retCert = context.membercerts.FirstOrDefault(c => c.ID == certId);
                if (retCert != null)
                {
                    retCert.Completed = true;

                    if (batchId != null && retCert.BatchID == null)
                    {
                        retCert.BatchID = batchId;
                    }
                }
                await context.SaveChangesAsync();
            }
        }