using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.Service
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public static class AuthExtensions
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public static List<Entity.UserRoleSelected> ToEntityList(this List<Model.UserRoleSelected> list)
|
{
|
if (list == null || list.Count() < 1)
|
return default;
|
return list.Select(x => new Entity.UserRoleSelected() { UserID = x.UserID, RoleID = x.RoleID, Selected = x.Selected }).ToList();
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public static List<Entity.RoleMenuSelected> ToEntityList(this List<Model.RoleMenuSelected> list)
|
{
|
if (list == null || list.Count() < 1)
|
return default;
|
return list.Select(x => new Entity.RoleMenuSelected() { RoleID = x.RoleID, MenuID = x.MenuID,AuthLevel=(int)x.AuthLevel, Selected = x.Selected }).ToList();
|
}
|
|
|
|
|
}
|
}
|