BootstrapAdmin/Bootstrap.DataAccess.MongoDB/Message.cs

23 lines
636 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>
protected override IEnumerable<DataAccess.Message> Retrieves(string userName)
2018-10-30 13:07:29 +08:00
{
var msg = DbManager.DBAccess.GetCollection<DataAccess.Message>("Messages");
2018-10-30 13:07:29 +08:00
return msg.Find(message => message.To == userName || message.From == userName).ToList();
}
}
}