I have question about pattern Table data Gateway… I´m creating small project, only for my purpose and I want to implement Table Data Gateway pattern. It is possible to use EntityFramework to create data manipulations method like Insert,Update, Delete for this pattern ? and use Data context for connecting to database ?
Thank you !
In Fowler’s examples for Table Data Gateway in POEE, you’ll see that he makes explicit SQL calls in the code and returns a record or dataset. For example:
Since Entity Framework abstracts that work for you I would argue that you’re not really using the pattern if you’re referencing EF entities. That said, you asked if it’s possible to do it and of course the answer’s yes. It seems to be more of a question of how ‘pure’ you want to be in implementing the pattern.