You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc-breeze-labs/directives-validation.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ And if there is an error, it displays like this:
25
25
26
26
Breeze entities have built-in model-level validation driven by metadata that describe client-side validation rules for properties and entities. Breeze invokes these rules automatically during four phases of the entity life-cycle (attached, queried, property changed, saved). You also can invoke these rules programmatically at any time.
27
27
28
-
You can read about these features [in the user guide](/doc-js/validation) and in the [Validator API documentation](/doc-js/api-docs/classes/Validator.html).
28
+
You can read about these features [in the user guide](/doc-js/validation) and in the [Validator API documentation](/doc-js/api-docs/classes/validator.html).
29
29
30
30
Those sources describe how to define validation rules and how to invoke them. They tell you that each entity carries a collection of zero-or-more validation errors that you can access by calling its `entityAspect.getValidationErrors()`
<p>We like to create a master <em>EntityManager</em><em>, </em>the <strong><em>masterManager</em></strong><em>, </em>as a template for minting the "derived" managers that we'll need throughout the user session. We create the <em>masterManager </em>with the route to the application's remote service (the "<em>applicationServiceName</em>"). Review the <ahref="/doc-js/api-docs/classes/EntityManager.html"target="_blank">EntityManager API</a> for other configuration options.</p>
79
-
<p>Most applications at this level of sophistication also <ahref="/doc-js/extending-entities"target="_blank">extend the entity model</a> with special client-side properties and behavior. This sample code assumes you've written a module dedicated to this purpose called <em>model</em> and it has a <em>configureMetadata </em>method. We're telling it to extend the <em>masterManager's</em> <ahref="/doc-js/api-docs/classes/MetadataStore.html"target="_blank">MetadataStore</a> which will be shared by all of the<em> dervived EntityManagers</em>.</p>
78
+
<p>We like to create a master <em>EntityManager</em><em>, </em>the <strong><em>masterManager</em></strong><em>, </em>as a template for minting the "derived" managers that we'll need throughout the user session. We create the <em>masterManager </em>with the route to the application's remote service (the "<em>applicationServiceName</em>"). Review the <ahref="/doc-js/api-docs/classes/entitymanager.html"target="_blank">EntityManager API</a> for other configuration options.</p>
79
+
<p>Most applications at this level of sophistication also <ahref="/doc-js/extending-entities"target="_blank">extend the entity model</a> with special client-side properties and behavior. This sample code assumes you've written a module dedicated to this purpose called <em>model</em> and it has a <em>configureMetadata </em>method. We're telling it to extend the <em>masterManager's</em> <ahref="/doc-js/api-docs/classes/metadatastore.html"target="_blank">MetadataStore</a> which will be shared by all of the<em> dervived EntityManagers</em>.</p>
80
80
<p>The <strong><em>createManager </em></strong>method returns a copy of the <em>masterManager </em>minus the entities. That copy may be all you need or want from the <em>masterManager</em>. But remember, each manager is its own microcosm. Entity navigation (e.g., <em>Order.Status, Order.Customer</em>, <em>Customer.Orders</em>) is possible only among entities within the same <em>EntityManager</em>. You won't be able to navigate from an <em>Order </em>in a derived manager back to a <em>Status </em>in the <em>masterManager</em>. Therefore, it's often convenient to populate the new manager with some of the picklist data from the <em>masterManager.</em></p>
81
81
<p>You'll know which supporting entities to copy based on the needs of the "sandbox" or subsidiary workflow. In time you may add custom "<em>createManager</em>" methods, tailored to suit the different types of sandboxes and workflows in your application.</p>
82
82
<p>The <strong><em>initialize </em></strong>function is optional but highly recommended. Most applications acquire some data from the server, such as picklist data for comboboxes, before they open up the UI to user input. The <em>masterManager </em>is a good place to hold this data. The application bootstrapper - the component that jumpstarts the application upon launch - is the likely caller of this <em>initiialize</em> function.</p>
<p>The following is a summary of the methods available on the EntityManager arranged by task. For a complete list of methods, please see the <ahref="/doc-js/api-docs/classes/EntityManager.html">EntityManager API documentation</a>.</p>
28
+
<p>The following is a summary of the methods available on the EntityManager arranged by task. For a complete list of methods, please see the <ahref="/doc-cs/api-docs/?topic=html/T_Breeze_Sharp_EntityManager.htm">EntityManager API documentation</a>.</p>
Copy file name to clipboardExpand all lines: doc-cs/query-in-depth.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ You can query these endpoints by adding the `.WithParameters(...)` clause to you
60
60
61
61
>This is probably how you will query servers that are not written with .NET technologies.
62
62
63
-
<pclass="note">Brian Noyes has an <ahref="http://briannoyes.net/2014/02/13/passing-complex-query-parameters-with-breeze/"target="_blank"title="Passing Complex Query Parameters with Breeze"><strong>excellent blog post</strong></a> describing <code>WithParameters</code> queries in great detail. His examples are in JavaScript but the same API is present in the Breeze.Sharp product.</p>
63
+
<pclass="note">Brian Noyes has an <ahref="http://briannoyes.net/passing-complex-query-parameters-with-breeze/"target="_blank"title="Passing Complex Query Parameters with Breeze"><strong>excellent blog post</strong></a> describing <code>WithParameters</code> queries in great detail. His examples are in JavaScript but the same API is present in the Breeze.Sharp product.</p>
Copy file name to clipboardExpand all lines: doc-main/release-notes.md
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -239,7 +239,7 @@ there should be no breaking changes). This JSON syntax ***complements*** the "fl
239
239
#### Breaking changes
240
240
- D2574 - Attention OData JsonResultsAdapter authors. The `entityAspect.extraMetadata` is now preserved by `exportEntities`. While fixing, we changed the related property of the `JsonResultsAdapter.visitNode` result from `result.extra` to `result.extraMetadata`. Correct your JsonResultsAdapter accordingly.
241
241
242
-
- D2602 - "After save the `entityAspect.propertyChanged` event is no longer raised for a property that was changed on the server". Actually propertyChanged **is still raised** in that situation. But Breeze only **raises the event once**. The value of the `propertyChangedArgs.propertyName` is `null` which means "many properties changed". This behavior [**was described in the API documentation**](/doc-js/api-docs/classes/EntityAspect.html#event_propertyChanged). Previously Breeze raised a separate event for *each changed property individually* for every merged entity ... which may have been convenient but was not correct . If you relied on the (incorrect) behavior, you will experience the proper behavior as a breaking change.
242
+
- D2602 - "After save the `entityAspect.propertyChanged` event is no longer raised for a property that was changed on the server". Actually propertyChanged **is still raised** in that situation. But Breeze only **raises the event once**. The value of the `propertyChangedArgs.propertyName` is `null` which means "many properties changed". This behavior [**was described in the API documentation**](/doc-js/api-docs/classes/entityaspect.html#propertychanged). Previously Breeze raised a separate event for *each changed property individually* for every merged entity ... which may have been convenient but was not correct . If you relied on the (incorrect) behavior, you will experience the proper behavior as a breaking change.
+ The [EntityManager.importEntities](/doc-js/api-docs/classes/EntityManager.html#method_importEntities) instance method now returns an object containing the list of entities imported and any temporary key mappings that occurred as a result of the import. The static version of this method has not changed, it still creates and returns a new EntityManager containing the imported entities.
674
-
+ An additional 'parent' property was added to the arguments passed to the [EntityAspect.propertyChanged](/doc-js/api-docs/classes/EntityAspect.html#event_propertyChanged) event. The value of this property will be different from that of the 'entity' property when the property in question is part of a nested complex type structure.
675
-
+ The [MetadataStore.importMetadata](/doc-js/api-docs/classes/MetadataStore.html#method_importMetadata) method can now process 'Breeze' native metadata imports where base classes may not be defined before their subclasses. i.e. order no longer matters.
676
-
+ The 'value' parameter in the [Predicate](/doc-js/api-docs/classes/Predicate.html) constructor is now overloaded to optionally support an object with 'value', 'isLiteral' and 'dataType' properties. This change was made to support queries where Breeze's inference engine does not have sufficient information to correctly infer the 'dataType' of a query clause.
677
-
+ The [Predicate.create](/doc-js/api-docs/classes/Predicate.html#method_create) method and the Predicate constructor have been extended so that both will now also accept a standard 'OData' query clause. OData clauses may also be combined with any standard query clauses. However, any EntityQuery containing an explicit OData clause will only be executable remotely, i.e. you cannot execute these queries locally.
673
+
+ The [EntityManager.importEntities](/doc-js/api-docs/classes/entitymanager.html#importentities) instance method now returns an object containing the list of entities imported and any temporary key mappings that occurred as a result of the import. The static version of this method has not changed, it still creates and returns a new EntityManager containing the imported entities.
674
+
+ An additional 'parent' property was added to the arguments passed to the [EntityAspect.propertyChanged](/doc-js/api-docs/classes/entityaspect.html#propertychanged) event. The value of this property will be different from that of the 'entity' property when the property in question is part of a nested complex type structure.
675
+
+ The [MetadataStore.importMetadata](/doc-js/api-docs/classes/metadatastore.html#importmetadata) method can now process 'Breeze' native metadata imports where base classes may not be defined before their subclasses. i.e. order no longer matters.
676
+
+ The 'value' parameter in the [Predicate](/doc-js/api-docs/classes/predicate.html) constructor is now overloaded to optionally support an object with 'value', 'isLiteral' and 'dataType' properties. This change was made to support queries where Breeze's inference engine does not have sufficient information to correctly infer the 'dataType' of a query clause.
677
+
+ The [Predicate.create](/doc-js/api-docs/classes/predicate.html#create) method and the Predicate constructor have been extended so that both will now also accept a standard 'OData' query clause. OData clauses may also be combined with any standard query clauses. However, any EntityQuery containing an explicit OData clause will only be executable remotely, i.e. you cannot execute these queries locally.
+ The [Predicate.and](/doc-js/api-docs/classes/Predicate.html#method_and) and [Predicate.or](/doc-js/api-docs/classes/Predicate.html#method_or) methods have been extended so that any arrays or parameters passed into these methods are automatically filtered to exclude null or undefined 'predicates'. This allow for simpler composition of complex query expressions.
681
+
+ The [Predicate.and](/doc-js/api-docs/classes/predicate.html#and) and [Predicate.or](/doc-js/api-docs/classes/predicate.html#or) methods have been extended so that any arrays or parameters passed into these methods are automatically filtered to exclude null or undefined 'predicates'. This allow for simpler composition of complex query expressions.
682
682
683
683
// works even if any or all of pred1, pred2 or pred3 is null or undefined.
684
684
var predicate = Predicate.and([pred1, pred2, pred3]);
@@ -707,7 +707,7 @@ Use them as you would the other stock validators. Here's an example:
707
707
var websiteProperty = personType.getProperty("website"); //get the property definition to validate
708
708
websiteProperty.validators.push(Validator.url()); // push a new validator instance onto that property's validators
709
709
710
-
With the [`breeze.Validator.makeRegExpValidator`](/doc-js/api-docs/classes/Validator.html#method_makeRegExpValidator) static helper, you can quickly mint new validators that encapsulate a regular expression. For example, we can create a U.S. zipcode validator and apply it to one of the `Customer` properties.
710
+
With the [`breeze.Validator.makeRegExpValidator`](/doc-js/api-docs/classes/validator.html#makeregexpvalidator) static helper, you can quickly mint new validators that encapsulate a regular expression. For example, we can create a U.S. zipcode validator and apply it to one of the `Customer` properties.
711
711
712
712
// Make a zipcode validator
713
713
function zipValidator = breeze.Validator.makeRegExpValidator(
@@ -723,7 +723,7 @@ With the [`breeze.Validator.makeRegExpValidator`](/doc-js/api-docs/classes/Valid
723
723
var zipProperty = custType.getProperty("PostalCode"); //get the PostalCode property definition
724
724
zipProperty.validators.push(zipValidator); // get that property's validators and push on the zipValidator
725
725
726
-
[See the API docs](/doc-js/api-docs/classes/Validator.html) for more information on how to use these new validators.
726
+
[See the API docs](/doc-js/api-docs/classes/validator.html) for more information on how to use these new validators.
727
727
728
728
>Many of these new validators correlate to <ahref="http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.aspx"target="_blank">.NET data annotations</a>. In a future release, the Breeze.NET `EFContextProvider`will be able to include these validations in the metadata automatically for you. For now, you'll have to add them to the properties on the client side as shown above.
729
729
@@ -752,15 +752,15 @@ With the [`breeze.Validator.makeRegExpValidator`](/doc-js/api-docs/classes/Valid
752
752
753
753
#### Server side (.NET)
754
754
755
-
+ New server-side interception point, [AfterSaveEntities](/doc-net/ef-efcontextprovider#AfterSaveEntities).
755
+
+ New server-side interception point, [AfterSaveEntities](/doc-net/ef-efcontextprovider-4x#AfterSaveEntities).
756
756
757
-
+ New options for server-side transaction control. `SaveChanges` now has an optional [TransactionSettings](/doc-net/ef-efcontextprovider#TransactionSettings) parameter, which controls the type of transaction that wraps the `BeforeSaveEntites`, `SaveChangesCore`, and `AfterSaveEntities` methods.
757
+
+ New options for server-side transaction control. `SaveChanges` now has an optional [TransactionSettings](/doc-net/ef-efcontextprovider-4x#TransactionSettings) parameter, which controls the type of transaction that wraps the `BeforeSaveEntites`, `SaveChangesCore`, and `AfterSaveEntities` methods.
758
758
759
-
+ New methods on [ContextProvider](/doc-net/ef-efcontextprovider#ContextProvidermethods) for use in `BeforeSaveEntities` and `AfterSaveEntities`. These methods help allow re-use of database connections, which reduces the need for distributed transactions.
759
+
+ New methods on [ContextProvider](/doc-net/ef-efcontextprovider-4x#ContextProvidermethods) for use in `BeforeSaveEntities` and `AfterSaveEntities`. These methods help allow re-use of database connections, which reduces the need for distributed transactions.
760
760
761
-
+[Save validation](/doc-net/ef-serverside-validation) enhancements. (Communicate server side validation errors to the client.)
761
+
+[Save validation](/doc-net/ef-serverside-validation-4x) enhancements. (Communicate server side validation errors to the client.)
762
762
763
-
+[Server side validation errors](/doc-net/ef-serverside-validation) can be returned in using .NET Validation Attributes or by throwing an *EntityErrorsException* within the server side *BeforeSaveEntities* delegate or virtual method.
763
+
+[Server side validation errors](/doc-net/ef-serverside-validation-4x) can be returned in using .NET Validation Attributes or by throwing an *EntityErrorsException* within the server side *BeforeSaveEntities* delegate or virtual method.
Copy file name to clipboardExpand all lines: doc-net/contextprovider-4x.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -254,7 +254,7 @@ The `SaveChangesCore` method performs the save operations on the change-set. The
254
254
255
255
Most developers rely on a pre-existing derived class such as the `EFContextProvider` to implement this method and there is rarely a need to override that implementation.
256
256
257
-
You will override it if you write your own `ContextProvider`. That task is beyond the scope of this topic. You'll find clues in the `TodoContext` class of the ["NoDB" sample](/doc-samples/no-db ""NoDB" sample") and in the <ahref="https://github.com/Breeze/breeze.server.net/blob/master/Breeze.ContextProvider.EF6/EFContextProvider.cs"title="EFContextProvider on GitHub"target="_blank">source code for the `EFContextProvider`</a>. There's also a discussion of `ContextProvider` extensibility in [this StackOverflow answer](http://stackoverflow.com/questions/21691579/uninitialised-jsonserializer-in-breeze-savebundletosavemap-sample/27414629#27414629).
257
+
You will override it if you write your own `ContextProvider`. That task is beyond the scope of this topic. You'll find clues in the `TodoContext` class of the ["NoDB" sample](/doc-samples/no-db ""NoDB" sample") and in the <ahref="https://github.com/Breeze/breeze.server.net/blob/master/AspNet/Breeze.ContextProvider.EF6/EFContextProvider.cs"title="EFContextProvider on GitHub"target="_blank">source code for the `EFContextProvider`</a>. There's also a discussion of `ContextProvider` extensibility in [this StackOverflow answer](http://stackoverflow.com/questions/21691579/uninitialised-jsonserializer-in-breeze-savebundletosavemap-sample/27414629#27414629).
0 commit comments