Skip to content

Commit e6b3c72

Browse files
committed
Added functions for adding child filters and conditions post fluent query creation. Added NoLock explanation to ReadMe
1 parent 1cc7ccc commit e6b3c72

14 files changed

Lines changed: 6257 additions & 5683 deletions

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,21 @@ This library can be used in CRM Plugins / Workflow Activities and in code of ext
1111
It does not include references / dependencies to any CRM SDK, so you can just install it and choose the CRM SDK that you need yourself.
1212
All CRM versions from 2011 to 365 are supported, just include the one you need to your project.
1313

14+
# Remarks
15+
This library sets the NoLock parameter on your QueryExpressions to true by default (plain QueryExpressions don't).
16+
This is a recommended best practice, as otherwise the records would be locked in the database before retrieval, which might result in decreased performance.
17+
There's also a limit of how much concurrent locked queries can run concurrently. Find out more about NoLock [here](https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.query.queryexpression.nolock.aspx).
18+
19+
If you choose to lock the data for retrieval, set `service.With.DataBaseLock()`.
20+
1421
# Purpose
1522
QueryExpressions add nice IntelliSense, however they tend to be quite verbose, which leads to poor readability.
1623
This fluent interface aims to make queries as short and readable as possible while preserving IntelliSense.
1724

1825
This could look something like this (When not developing early bound, you can simply leave out the generic parameter):
1926
```C#
2027
var records = service.Query<Account>()
21-
.IncludeColumns("name")
28+
.IncludeColumns("name", "address1_line1")
2229
.Where(e => e
2330
.Attribute(a => a
2431
.Named("name")
@@ -41,7 +48,7 @@ The equivalent QueryExpression for above fluent query would be:
4148
var query = new QueryExpression
4249
{
4350
EntityName = "account",
44-
ColumnSet = new ColumnSet("name"),
51+
ColumnSet = new ColumnSet("name", "address1_line1"),
4552
NoLock = true,
4653
Criteria = new FilterExpression
4754
{

build.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ let packagesDir = @".\packages\"
3030

3131
// version info
3232
let mutable majorversion = "1"
33-
let mutable minorversion = "0"
34-
let mutable build = "1"
33+
let mutable minorversion = "1"
34+
let mutable build = "0"
3535
let mutable nugetVersion = ""
3636
let mutable asmVersion = ""
3737
let mutable asmInfoVersion = ""

coverage.xml

Lines changed: 405 additions & 360 deletions
Large diffs are not rendered by default.

reports/Xrm.Oss.FluentQuery_FluentConditionExpression.htm

Lines changed: 808 additions & 759 deletions
Large diffs are not rendered by default.

reports/Xrm.Oss.FluentQuery_FluentFilterExpression.htm

Lines changed: 803 additions & 754 deletions
Large diffs are not rendered by default.

reports/Xrm.Oss.FluentQuery_FluentLinkEntity.htm

Lines changed: 809 additions & 760 deletions
Large diffs are not rendered by default.

reports/Xrm.Oss.FluentQuery_FluentOrderExpression.htm

Lines changed: 805 additions & 756 deletions
Large diffs are not rendered by default.

reports/Xrm.Oss.FluentQuery_FluentPagingInfo.htm

Lines changed: 804 additions & 755 deletions
Large diffs are not rendered by default.

reports/Xrm.Oss.FluentQuery_FluentQuery_1.htm

Lines changed: 819 additions & 764 deletions
Large diffs are not rendered by default.

reports/Xrm.Oss.FluentQuery_IOrganizationServiceFluentQuery.htm

Lines changed: 800 additions & 751 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)