You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.2 KiB
C#

6 years ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OAuth2Study.Model;
namespace OAuth2Study.IDal
{
public interface UserIDal
{
/// <summary>
/// 添加用户
/// </summary>
/// <param name="user">用户</param>
/// <returns>ValueTuple</returns>
(bool result, User user) AddUser(User user);
/// <summary>
/// 更新用户
/// </summary>
(bool result, User user) UpdateUser(User user);
/// <summary>
/// 删除用户
/// </summary>
bool RemoveUser(User user);
/// <summary>
/// 删除用户
/// </summary>
bool RemoveUser(int userId);
/// <summary>
/// 获取所有用户
/// </summary>
IQueryable<User> GetUsers();
/// <summary>
/// 查询用户
/// </summary>
IQueryable<User> GetUsers(Func<User,bool> predicate);
/// <summary>
/// 按Id查询用户
/// </summary>
User GetUser(int userId);
/// <summary>
/// 用户名是否存在
/// </summary>
bool ExitsByName(string userName);
}
}