Beispiel #1
0
        public void RemoveWordUserHistory(IWordUserHistory iwuh)
        {
            var hist = _histories.FirstOrDefault(x => x.Language == iwuh.Language && x.UserId == iwuh.UserId && x.Word == iwuh.Word);

            if (hist != null)
            {
                _histories.Remove(hist);
            }
        }
Beispiel #2
0
        public void SaveWordUserHistory(IWordUserHistory iwuh)
        {
            var hist = _histories.FirstOrDefault(x => x.Language == iwuh.Language && x.UserId == iwuh.UserId && x.Word == iwuh.Word);

            if (hist == null)
            {
                _histories.Add(iwuh);
            }
            else
            {
                hist = iwuh;
            }
        }
Beispiel #3
0
        public void SaveWordUserHistory(IWordUserHistory iwuh)
        {
            var hist = db.WordUserHistories.FirstOrDefault(x => x.Language == iwuh.Language && x.UserId == iwuh.UserId && x.Word == iwuh.Word);

            if (hist == null)
            {
                db.WordUserHistories.Add((WordUserHistory)iwuh);
            }
            else
            {
                hist = (WordUserHistory)iwuh;
            }
            db.SaveChanges();
        }