Esempio n. 1
0
 public async Task AddFREnrollerDetails(EnrollerDetail item)
 {
     try
     {
         await _context.FREnrollerDetail.InsertOneAsync(item);
     }
     catch (Exception ex)
     {
         // log or manage the exception
         throw ex;
     }
 }
Esempio n. 2
0
        public async Task <bool> UpdateEnrollerDetailDocument(string id, EnrollerDetail item)
        {
            try
            {
                ReplaceOneResult actionResult = await _context.FREnrollerDetail.ReplaceOneAsync(n => n.Id.Equals(id), item, new UpdateOptions { IsUpsert = true });

                return(actionResult.IsAcknowledged &&
                       actionResult.ModifiedCount > 0);
            }
            catch (Exception ex)
            {
                // log or manage the exception
                throw ex;
            }
        }