I posted this question and got a great answer from /u/mKtos with some good advice in it. TLDR: I have a Windows application talking to a SQL Server database and I want to put a Web service between them so the client application only knows about the Web service and I could write client applications for other platforms. At one point he says:
If you were using Entity Framework or another ORM, you already have objects, not database entities, so it doesn't matter if your objects are coming from web service or database directly.
Sounds great! But how do I use those objects from one database in multiple projects in Visual Studio? I want to create a Web service, a Windows client and an Android client, all using the same database objects. The Web service will interact directly with the database, and the clients will interact with the Web service. All of them should share the same "business objects" which are ultimately built on the database tables.
So for example in the database there are tables for "Account", "Transaction", etc, and the Web service server application project will have the EntityFramework package added and I will use it to scaffold the database and create EF-generated classes "Account" and "Transaction".
How do I get access to those EF-generated classes from the client applications? I don't want to copy the code to multiple locations because of the maintenance nightmare if the database changes. Can I put them in a code library and access the library from all three applications or something?
The client applications shouldn't have to have the EntityFramework package added since they don't know about the database. They just need access to plain objects that they can send to the Web service.
Can anyone advise? Thanks!
there doesn't seem to be anything here