In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what is the ADO.NET object service". In the daily operation, I believe many people have doubts about what the ADO.NET object service is. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "what is the ADO.NET object service?" Next, please follow the editor to study!
The ADO.NET object service supports language-integrated queries (LINQ) and Entity SQL queries against types defined in the entity data Model (EDM). The object service materializes the returned data into objects and propagates object changes back to the data source. It also provides the ability to track changes, bind objects to controls, and deal with concurrency issues. Object services are implemented by classes in the System.Data.Objects and System.Data.Objects.DataClasses namespaces.
Object context
The ObjectContext class is the main class that interacts with data in the form of objects that are instances of entity types defined in EDM. An instance of the ObjectContext class encapsulates the following:
The ◆ connection to the database is encapsulated in the form of an EntityConnection object.
◆ describes the metadata of the model, encapsulated in the form of MetadataWorkspace objects.
◆ tracks the ObjectStateManager objects of objects during create, update, and delete operations.
The entity framework tool uses conceptual schema definition language (CSDL) files and generates object-layer code. This code is used to use entity data in the form of objects and to take advantage of object service capabilities. The generated code includes the following data classes:
◆ typed the ObjectContext class. This class represents the EntityContainer of the model, which is derived from ObjectContext.
◆ represents a class of entity type that inherits from EntityObject.
◆ represents a class of complex types that inherits from ComplexObject.
The ObjectContext class is not thread safe. The integrity of data objects in ObjectContext cannot be guaranteed in a multithreaded scenario. The ADO.NET object service supports the following behaviors for programming entity frameworks:
1. Query data in the form of objects
With object services, you can use LINQ, Entity SQL, or query builder methods to execute queries against the entity data model and return data as objects.
By default, the object service returns only the objects specifically requested in the query. When there is a relationship between objects, you can specify whether the query returns related objects. You can also load related objects in subsequent requests.
3. Write a query using the generator method
Object services provide methods on ObjectQuery to construct queries equivalent to Entity SQL and LINQ to Entities queries.
4. Add, change, and delete objects
Object services keep data objects in memory, and you can add, modify, and delete objects in the object context. Changes to the object are tracked by the object context.
5. Save changes to the data source
The object service caches changes to the object in the object context. When explicitly requested, the object service saves these changes back to the data source.
6. Bind an object to a control
Object services can bind objects to controls that support data binding, such as DataGridView controls.
At this point, the study of "what is the ADO.NET object service" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.