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>
|
2019-01-11 23:20:28 +08:00
|
|
|
|
protected override IEnumerable<DataAccess.Message> Retrieves(string userName)
|
2018-10-30 13:07:29 +08:00
|
|
|
|
{
|
2019-01-15 12:52:09 +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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|