I currently have this:
instance = new Class1<Type1>(
"param1",
() =>
new ViewDataDictionary<Type2>(
new Class2
{
Prop1= CreateList(new List<long> { 234 }),
Prop2= CreateList(new long[] { 234 })
}) );
I want to pass a variable in the function CreateList instead. Something like this
long p1 = 123;
instance = new Class1<Type1>(
"param1",
() =>
new ViewDataDictionary<Type2>(
new Class2
{
Prop1= CreateList(new List<long> { p1}),
Prop2= CreateList(new long[] { p1})
}) );
But it gives me serialization error if I try to do the above. All the classes are marked serializable.