I have a fairly complex piece of logic that generates a IQueryable
for me that I use to return data from my database using Fluent.NHibernate
.
However, I need to be able to store the results of this query back into the database (just the primary keys really but that is kind of a side issue)
How can I generate an insert statement based on the IQueryable
I already have to get SQL like the example below generated:
INSERT INTO MySavedResults (Id, FirstName, LastName)
SELECT Id, FirstName, LastName FROM Member
WHERE
FirstName = 'John' and LastName ='Snow' and ...-- more conditions