In order to support the BreezeJS client, the server must undertake three key tasks:
- Ensure the provision of metadata to the client
- Understand and respond to queries from the client by providing data
- Save changes received from the client
All these functionalities are available in .NET 4.5 through tools like the EFContextProvider
(for Entity Framework) and NHContext
(for NHibernate). It is necessary to find a suitable approach to incorporate these features into your own solution.
Metadata: Can either be manually crafted or generated using EF during design (even if EF isn't used at runtime). For project-specific metadata needs, a general-purpose tool may not be required.
Queries: Can range from simple to complex based on application requirements. Implementing filtering, sorting, as well as pagination with skip
and take
might suffice. Parameterized queries can handle most operations, eliminating the need to parse URLs. While this approach limits query types accessible from the client, it could fulfill all necessities.
Saves: Breeze "save bundles" include an array of entities, each specifying change status (Added, Modified, Deleted) along with altered fields. These changes must be applied to the database with consideration for their sequence
(parent records addition preceding child records, deletion of child records before parent records).
In EFContextProvider, much of this functionality was managed by EF itself. In NHContext, querying is primarily handled through NH LINQ, while metadata generation and save processing were implemented in Breeze.ContextProvider.NH. You can refer to the GitHub repository for insights.
Take a look at the NoDB sample as well, illustrating usage without EF or NH.
We eagerly await hearing about your implementation. Exploring Breeze without an ORM presents an intriguing subject.