Brian Noyes is CTO and Architect at Solliance, an expert technology solutions development company. Brian is a Microsoft Regional Director and MVP, and specializes in rich client technologies including XAML and HTML 5, as well as building the services that back them with WCF and ASP.NET Web API.
Breeze Query Basics Hi there this is Brian Noyes and in this module we're going to go into some of the basics of doing Querying with Breeze. We'll learn about the querying patterns, code you need to write to execute a query, what kinds of queries are supported by Breeze, and basically how to shape your data from the client side telling the server side exactly what to give you back. So first we'll review quickly how you go about creating a Breeze EntityManager then we'll get into defining and executing your queries. Some of this you've seen in brief from in the module one demo but we'll start diving a little deeper here and make sure you know exactly what you need to do to start structuring your code for executing queries. Then we'll go through all the basic query operations that are supported by Breeze. We'll talk about each one in turn and demo them as well. We'll cover the select operator which allows you to do projection queries, this allows you to shape the data that comes back from the server and say you only want certain properties off the entities not all of the properties. And then we'll talk about Eager Loading queries, this is the case where you want more than just the top level collection if those objects in the collection have related entities you want to get those as well as part of the initial query. And that will cover all the basic querying capabilities and then in the next module we'll cover some more advanced nuances.
Breeze Advanced Querying Hi, this is Brian Noyes and in this module we're going to cover a few more ways of querying from Breeze. Now, I call this module Advanced Querying, there's nothing particularly intricate or involved about the querying I'm going to show here, it's just more fine grain control from the client-side and some nuance that you probably won't do as often as the mainstream querying I showed in the last module. So, what we're going to go through here is first talk about being able to pre-fetch your metadata. Sometimes you want to go out and make sure the client-side cache of metadata is prepopulated, and that's important for several reasons we'll talk about. Then we're going to talk about querying by key, the ability to go get a single entity at a time as long as you know the key value you're going after. We'll talk about getting a bag of entities, meaning multiple collections in a single round-trip to the server, which is typically done for things like populating all your dropdown lists of look-up values. Then we'll talk about being able to pass parameters when you issue your service queries that go above and beyond the ones that get implicitly passed in the OData query syntax for things like, filtering, ordering, and paging. We'll talk in demo briefly of the concept of server driven queries, that fact that not everything can be accommodated through the OData query syntax, so sometimes you've got to do some of the heavy lifting on the server-side, and just target a custom method on that server-side from the client. We'll look at re-querying data, once you've retrieved it to the client-side, you may actually want to go and refresh it with whatever the current state of the server is, and you can do that by specifying individual or specific collections of entities that you want to update. Then we'll finish off by talking about local queries, the ability to query against the cache of entities once they've already been retrieved so that you don't have to make additional round-trips to the server, and we'll look at both synchronous and asynchronous versions of those. So, let's dive right in.
Validation Part 1 Once you start editing data in a data-intensive, single-page application Validation becomes a very important concern. The good news is Breeze has some great capabilities here built in for doing both client-side and server-side Validation. Enough features that I need to break it up into two separate modules. So in this module we'll cover Part 1, the basics about Validation, and in the next module we'll get into some more detailed aspects that go beyond the basics. First, we're going to talk about validation in general and we'll talk about why you want to do it, where you want to do, and how you go about doing it with Breeze. Next, we'll talk about automatic validation, which is the way Breeze can automatically create certain kinds of rules for you, based on the metadata and invoke those rules at strategic times in the life cycle of working with that data and editing it. Next, we'll talk about Data Annotations, which are a part of the. NET framework that you can leverage if you're building your services using ASP. NET Web API and Breeze controllers. Then we'll finish off this module talking about how you go about using some of the built-in, client-side validation rules that Breeze includes that don't automatically get created. You'll see how you can create instances to these rules, attach them to properties, and make sure they get evaluated and show errors to the user. So let's dive right in.
Validation Part 2 In this module I'll pick up where I left off in the last module on Validation. And we'll dive in to some more advanced aspects including manually invoking Validation, creating custom client and server-side rules, and using Validation events. When I get done with this module you should know everything you need to know about Validation and Breeze to build out powerful, data-centric applications. So first in this module I'm going to cover manual validation. How you can manually invoke validation at any point in your code so that you have deterministic points in the code where you know the state of the entity with respect to validation. Next I'll get into how you can create custom client-side validation rules in Breeze and attach them to the properties of your entities. So whatever crazy, wacky business rules you may have that need to be enforced on the client-side you'll see how you can do that. Next we'll talk about validation events. How you can be notified whenever the validation errors associated with entities change. And then we'll finish off with how you can create custom server validation rules that get executed on the server side, but still communicate the right information to the client-side so that Breeze can provide you those entity errors. So let's dive right in.