oData/ADO.NET Data Services using LINQ-to-SQL with a decryption layer

Posted by Program.X on Stack Overflow See other posts from Stack Overflow or by Program.X
Published on 2010-04-15T09:50:53Z Indexed on 2010/04/15 9:53 UTC
Read the original article Hit count: 267

I have written an application using LINQ-to-SQL that submits a web form into a database. I absact the LINQ-to-SQL away using a Repository pattern.

This repository has the basic methods: Get(), Save(), etc.

As a development of the project, I needed to encrypt certain fields in the form. This was trivial, as I just added the encryption calls to the Get(), Save() methods in the Repository.

Now, I want to put an oData layer over it, to allow RESTful extraction from MS Excel 2010 (when it comes out). I have this working, after a few stumbles on useless error messages, etc.

However, obviously, those encrypted fields are still encrypted. My repository pattern would have decrypted these for me. As far as I know, I have to directly bind my oData service to the LINQ-to-SQL context for the schema, etc. to work - unless I enter a whole world of pain (any URLs appreciated).

Is there a way I can insert my encryption/decryption layer into the request so decryption is done "on the fly"? I looked at the OnStartProcessingRequest() overload of DataService but this doesn't seem that useful.

© Stack Overflow or respective owner

Related posts about OData

Related posts about ado.net-data-services