public static ToDto ( this entity, System.Guid roleId ) : |
||
entity | this | 资源实体 |
roleId | System.Guid | 角色编号 |
return |
public static ResourceDto ToDto(this Resource entity, Guid roleId)
{
ResourceDto dto = entity.MapTo<ResourceDto>();
dto.Checked = entity.Permissions.Any(p => p.RoleId == roleId);
return dto;
}