using System; using System.Collections.Generic; using System.Linq; using System.Web; using System; using System.Threading.Tasks; using MongoDB.Bson; using MongoDB.Driver; using AIAHTML5.API.Properties; using MongoDB.Driver.Builders; namespace AIAHTML5.API.Models { public class LabExercises { public int Attemptnumber { get; set; } public string labExerciseCode { get; set; } public string Answer { get; set; } public int Question { get; set; } public int Score { get; set; } public void UpdateUserLabExercise(Users objUser) { var client = new MongoClient(); var db = client.GetDatabase(Settings.Default.database); var collection = db.GetCollection("Users"); collection.UpdateOne( Builders.Filter.Eq("loginId", objUser.loginId), Builders.Update.Set("LabExerciseAttempt", objUser.labExerciseAttempt)); } } }