2019-03-04 13:21:04 +08:00
|
|
|
|
using MongoDB.Driver;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace Bootstrap.DataAccess.MongoDB
|
2019-03-04 02:41:53 +08:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class LoginUser : DataAccess.LoginUser
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="user"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public override bool Log(DataAccess.LoginUser user)
|
|
|
|
|
{
|
|
|
|
|
DbManager.LoginUsers.InsertOne(user);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2019-03-04 13:21:04 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public override IEnumerable<DataAccess.LoginUser> Retrieves() => DbManager.LoginUsers.Find(FilterDefinition<DataAccess.LoginUser>.Empty).SortByDescending(user => user.LoginTime).ToList();
|
2019-03-04 02:41:53 +08:00
|
|
|
|
}
|
|
|
|
|
}
|