LINQ newbie question

  • Thread starter Thread starter balint kardos
  • Start date Start date
B

balint kardos

Hi all,

My question is about parsing and saving a LINQ query from/to xml.
I'm creating an web interface where a user can select fields from dataset
tables, and create relations between them (think about creating a sql
report); I would like to save and reload the query, and I'm trying to
implement it as a LINQ query.
Is there any way to do this?

Thanks,

Balint
 
Balint,

There isn't really any way to do this, since the IEnumerable
implementations returned by the LINQ libraries are not marked as
serializable in any way.

You would have to manually serialize the query.

You might want to serialize the parts of the query in other forms (not
the actual elements in .NET, but the concept of the query, like which
fields, the where clause, the sort order) and then construct the query later
dynamically.
 
Hi Nicholas,

thank you for your answer, I'll try to implement it.

b.

Nicholas Paldino said:
Balint,

There isn't really any way to do this, since the IEnumerable
implementations returned by the LINQ libraries are not marked as
serializable in any way.

You would have to manually serialize the query.

You might want to serialize the parts of the query in other forms (not
the actual elements in .NET, but the concept of the query, like which
fields, the where clause, the sort order) and then construct the query
later dynamically.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

balint kardos said:
Hi all,

My question is about parsing and saving a LINQ query from/to xml.
I'm creating an web interface where a user can select fields from dataset
tables, and create relations between them (think about creating a sql
report); I would like to save and reload the query, and I'm trying to
implement it as a LINQ query.
Is there any way to do this?

Thanks,

Balint
 
Back
Top