using MongoDB.Driver; using System.Collections.Generic; namespace Bootstrap.DataAccess.MongoDB { /// /// /// public class Message : DataAccess.Message { /// /// /// /// /// protected override IEnumerable Retrieves(string userName) { return DbManager.Messages.Find(message => message.To.ToLowerInvariant() == userName.ToLowerInvariant() || message.From.ToLowerInvariant() == userName.ToLowerInvariant()).ToList(); } /// /// /// /// /// public override bool Save(DataAccess.Message msg) { DbManager.Messages.InsertOne(msg); return true; } } }