using iWareCommon.Common.Dao;
|
using iWareDataCore.ORM;
|
using iWareDataCore.RBAC.Entity;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace iWareDataCore.RBAC.Dao
|
{
|
public class RoleDao : CommonDao<RoleEntity, RBACRole>
|
{
|
|
private static object Lock = new object();
|
|
private RoleDao() { }
|
|
private static RoleDao Instance = null;
|
|
/// <summary>
|
/// 获取单例的方法
|
/// </summary>
|
/// <returns>角色服务的单例实体</returns>
|
public static RoleDao GetInstance()
|
{
|
|
if (Instance == null)
|
{
|
lock (Lock)
|
{
|
if (Instance == null)
|
{
|
Instance = new RoleDao();
|
}
|
}
|
}
|
return Instance;
|
}
|
|
|
protected override string GetColumnName(string name)
|
{
|
return RoleEntity.GetColumnName(name);
|
}
|
|
protected override string GetTableName()
|
{
|
return RoleEntity.GetTableName();
|
}
|
|
protected override RoleEntity ToEntity(RBACRole s)
|
{
|
return new RoleEntity(s);
|
}
|
|
protected override RBACRole ToOrm(RoleEntity t)
|
{
|
return t.ToOrm();
|
}
|
|
protected override List<string> GetColumnNames()
|
{
|
return RoleEntity.GetColumnMap().Keys.ToList();
|
}
|
|
}
|
}
|