collection:
+ return isNullable ? (object)collection.Select(ParseStringToChar).ToList() : collection.Select(t => ParseStringToChar(t).GetValueOrDefault()).ToList();
- return null;
+ default:
+ return null;
+ }
}
}
}
diff --git a/Import-PfxCertificate.psm1 b/Import-PfxCertificate.psm1
deleted file mode 100644
index 0ce403b..0000000
--- a/Import-PfxCertificate.psm1
+++ /dev/null
@@ -1,31 +0,0 @@
-function Import-PfxCertificate {
- Param (
- [string] $pfx,
- [string] $password,
- [string] $containerName
- );
- process {
- if(!(Test-Path -Path $pfx)) {
- Write-Warning "Unable to locate PFX file: $pfx";
- return;
- }
-
- $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2;
- $cert.Import($pfx, $password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::Exportable);
- $exportPrivateKeyInformation = $true;
- $certXml = $cert.PrivateKey.ToXmlString($exportPrivateKeyInformation);
-
- $csp = New-Object System.Security.Cryptography.CspParameters;
- $csp.KeyContainerName = $containerName;
- $csp.Flags = [System.Security.Cryptography.CspProviderFlags]::UseMachineKeyStore -bor [System.Security.Cryptography.CspProviderFlags]::NoPrompt; # -bor is bitwise or
- $csp.KeyNumber = [System.Security.Cryptography.KeyNumber]::Signature;
-
- $rsa = New-Object System.Security.Cryptography.RSACryptoServiceProvider $csp;
- $rsa.FromXmlString($certXml);
- $rsa.Clear();
-
- "Sucesfully imported $pfx into StrongName CSP store";
- }
-}
-
-Export-ModuleMember -Function Import-PfxCertificate;
\ No newline at end of file
diff --git a/README.md b/README.md
index 42fd509..d845119 100644
--- a/README.md
+++ b/README.md
@@ -3,10 +3,10 @@
- A .NET Standard lambda expression generator for creating dynamic predicates.
+ A .NET Standard lambda expression generator for building dynamic predicates.
-
+
@@ -23,7 +23,7 @@
-
+
@@ -40,8 +40,8 @@
## What is Exprelsior?
-Exprelsior is a .NET Standard library that enables .NET developers to create strongly-typed
-binary lambda expressions from pure text using it's own query syntax or from the expression builder method.
+Exprelsior is a .NET Standard library that enables .NET developers to dynamically create strongly-typed
+binary lambda expressions from pure text using it's own query syntax.
With support to all major .NET data types, including nullable types, nested properties and it's own query syntax, Exprelsior
brings the creation of dynamic predicates to a whole new level.
@@ -54,6 +54,7 @@ brings the creation of dynamic predicates to a whole new level.
2. [Usage](#2-usage)
1. [Query Syntax Example](#query-syntax-example)
2. [Expression Builder Example](#expression-builder-example)
+ 3. [Property Accessor Example](#property-accessor-example)
3. [The Query Syntax](#3-the-query-syntax)
1. [Query Elements](#query-elements)
2. [Creating Simple Queries](#simple-queries)
@@ -71,7 +72,7 @@ brings the creation of dynamic predicates to a whole new level.
## 1. Overview
-The objective of this library is to build binary lambda expressions in an dynamic manner.
+The objective of this library is to build binary lambda expressions in a dynamic manner.
Example:
@@ -132,6 +133,23 @@ public async Task Get([FromQuery] int @operator, [FromQuery] stri
return result;
}
```
+
+### Property Accessor Example
+
+```csharp
+[HttpGet]
+public async Task Get()
+{
+ var accessor = ExpressionBuilder.CreateAccessor("DateOfBirth.Date");
+
+ // accessor = (Expression>) t => t.DateOfBirth.Date
+
+ var result = await FooRepository.Query.OrderBy(accessor).ToList();
+
+ return result;
+}
+```
+
---
## 3. The Query Syntax
diff --git a/SnInstallPfx.exe b/SnInstallPfx.exe
new file mode 100644
index 0000000..683d922
Binary files /dev/null and b/SnInstallPfx.exe differ
diff --git a/appveyor.yml b/appveyor.yml
index 3a2bff7..daaec3a 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -42,8 +42,7 @@ before_build:
# Import PFX file for strong naming assemblies.
- ps: |
- Import-Module "$env:APPVEYOR_BUILD_FOLDER\Import-PfxCertificate.psm1";
- Import-PfxCertificate -pfx "$env:APPVEYOR_BUILD_FOLDER\ExprelsiorKey.pfx" -password $env:certificate_pass -containerName $env:certificate_container_name;
+ Start-Process -FilePath "$env:APPVEYOR_BUILD_FOLDER\SnInstallPfx.exe" -ArgumentList "$env:APPVEYOR_BUILD_FOLDER\ExprelsiorKey.pfx $env:certificate_pass" -NoNewWindow
- ps: dotnet restore