BootstrapAdmin/Bootstrap.DataAccess.MongoDB/Message.cs

23 lines
654 B
C#
Raw Normal View History

2018-10-30 13:07:29 +08:00
using MongoDB.Driver;
using System.Collections.Generic;
namespace Bootstrap.DataAccess.MongoDB
{
2018-10-31 17:50:13 +08:00
/// <summary>
///
/// </summary>
2018-10-30 13:07:29 +08:00
public class Message : DataAccess.Message
{
2018-10-31 17:50:13 +08:00
/// <summary>
///
/// </summary>
/// <param name="userName"></param>
/// <returns></returns>
2018-10-30 13:07:29 +08:00
protected override IEnumerable<DataAccess.Message> RetrieveMessages(string userName)
{
var msg = MongoDbAccessManager.DBAccess.GetCollection<DataAccess.Message>("Messages");
return msg.Find(message => message.To == userName || message.From == userName).ToList();
}
}
}