I have a class which has some expression tree properties. when I try to serialize it using the serializable attribute in order to configure SQL Server Session State, I have got the following error:
..Unable to serialize the session state, SerializationException: Type 'System.Linq.Expressions.Expression
..., as the picture shows.
Does anybody know how can I solve that problem to be able to manage session state on SQLServer mode. Thanks.
My class looks to something like this:
[Serializable]
public class Elements<T>
{
public List<T> elementsList { get; set;}
Expression<Func<int, bool>> lambda = num => num < 5;
}