f# - How to return a query from an anonymous function and pass it to a forward pipe -
I have a query that is then forwarded to an anonymous function. I would like to use this function to query and then pipe it to the next function. It is certain that if it is possible, then I am having trouble completing this.
So far I have this:
// find fileFileToDelete id = // query query {for line in db. Upload, where (line.id = id) select the row properly on the orphault} | & Gt; (Fun q -> delete file (q.FilePath))
But I would like to continue with something like this:
/ / Find the file to delete FindFileToDelete for id = // query query {db in line. Upload, where (line.id = id) select the row properly on the orphault} | & Gt; (Function q - & gt; Delete File (q.FilePath)) q // Forward pipe query | & Gt; DeleteRowFrom db.Uploads q // Save the database TOODb ()
As Mark Generally, pipelining is used for a series of changes , your code does a series of tasks , I recommend writing it like this:
// Find the file to remove FindFileToDelete id = Allow line = Query {db for the row. Upload where (row.Id = id) exactlyOneOrDefault} file .Delete line.Delete filePathSpeed from DM.Upload line // Secure database DODB ()
Comments
Post a Comment