Best practice for creating an ADO.NET DataService client

I have windows creating applications and server services based on ADO.NET data. Is it a good practice to create and initialize one static dataservice client in a Windows application and use it throughout the program? For example, I can use it in all open forms (which have bindings to datacontext data objects) to call SaveChanges () and not lose tracking. Or is it better to create an instance of the service client for each new form (because I think after a while with one static client it will have huge memory growth)? But when I create a new client for each form, I assume that every time I create a new connection to the service.

Maybe I'm wrong and a little confused in using the services in the client application. Please help me understand how this works.

+3
source share
2 answers

DataServiceContext . OData, , REST , , . . (, ) . . , "" . . / ( , 1000), . , "" , SaveChanges, .

+2

: .;) , , , Entity Framework. .

EF , . , , .

, .

0

Source: https://habr.com/ru/post/1758163/


All Articles