Example #1
0
 public void ReplaceActivatedSubject(Share.ActivatedSubject activatedSubject)
 {
     if (activatedSubject != null)
     {
         var coltn = helper.GetCollection <Share.ActivatedSubject>(ShareData_ActivatedSubject);
         var opt   = new UpdateOptions()
         {
             IsUpsert = true,
         };
         coltn.ReplaceOne(it => it._id == activatedSubject._id, activatedSubject, opt);
     }
     else
     {
         throw new ArgumentNullException("null input from ActivatedSubject  ");
     }
 }
Example #2
0
 public void CreateActivatedSubject(Share.ActivatedSubject activatedSubject)
 {
     if (activatedSubject != null)
     {
         var coltn = helper.GetCollection <Share.ActivatedSubject>(ShareData_ActivatedSubject);
         var opt   = new UpdateOptions()
         {
             IsUpsert = true,
         };
         coltn.InsertOne(activatedSubject);
     }
     else
     {
         throw new ArgumentNullException("null input from ActivatedSubject  ");
     }
 }