0

Our old application had a middle tier which held business logic and talked to the db, it then talked to 2 clients, one Winforms and one Asp.Net, neither of which knew anything about what kind of database it was speaking to. It used DataSets and DataReaders.

What's the modern equivalent? Are tiers still needed?

There's plenty of questions and answers out there but they all seem a little dated. I'm getting the impression that it should be a tier with Web API and the entity framework which talks to a separate WPF client and something like a Angular JS client.

I'll happily buy a few books if someone could suggest some

tony
  • 2,094
  • 1
  • 21
  • 36

1 Answers1

0

For anyone else new to the entity framework. The difficulty here was that the web is full of advice that was correct at the time but becomes out of date. So, for EF6...

There are posts online in which Self tracking Entities were advised (Aug 2013), e.g.

Entity Framework not saving modified children

however they have since become deprecated.

https://msdn.microsoft.com/en-us/data/jj613924.aspx

A page that covers the valid approaches is:

https://msdn.microsoft.com/en-us/data/jj613668

which mentions: Web API, WCF Data Services and also a 'roll your own' approach. The latter is covered in the book 'Programming Entity Framework: DbContext by Julia Lerman'.

Assuming you go down the Web API approach there's an example here:

http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-1

Community
  • 1
  • 1
tony
  • 2,094
  • 1
  • 21
  • 36
  • One last thing to add. The Web API example has a simple case, just an add. The book shows a scenario where you could have any number of changed objects and it has a method to fix them up – tony Jan 31 '16 at 19:26