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: LICENSE.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
MIT License
2
2
3
-
Copyright (c) 2021 Carlos Villegas
3
+
Copyright (c) Carlos Villegas
4
4
5
-
Contains portions of LINQKit (https://github.com/scottksmith95/LINQKit). Copyright (c) 2007-2019 Joseph Albahari, Tomas Petricek, Scott Smith.
5
+
Contains portions of:
6
+
-[LINQKit](https://github.com/scottksmith95/LINQKit). Copyright (c) 2007-2019 Joseph Albahari, Tomas Petricek, Scott Smith.
7
+
-[.NET Runtime](https://github.com/dotnet/runtime). Copyright (c) .NET Foundation and Contributors.
6
8
7
9
Permission is hereby granted, free of charge, to any person obtaining a copy
8
10
of this software and associated documentation files (the "Software"), to deal
Copy file name to clipboardExpand all lines: docs/README.md
+31-17Lines changed: 31 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,10 @@
1
1
# QueryableValues
2
2
3
-
This library allows you to efficiently compose an [IEnumerable<T>] in your [Entity Framework Core] queries when using the [SQL Server Database Provider]. This is accomplished by using the `AsQueryableValues` extension method available on the [DbContext] class. Everything is evaluated on the server with a single round trip, in a way that preserves the query's [execution plan], even when the values behind the [IEnumerable<T>] are changed on subsequent executions.
This library allows you to efficiently compose an [IEnumerable<T>] in your [Entity Framework Core] queries when using the [SQL Server Database Provider]. This is accomplished by using the `AsQueryableValues` extension method available on the [DbContext] class. Everything is evaluated on the server with a single round trip, in a way that preserves the query's [execution plan], even when the values behind the [IEnumerable<T>] are changed on subsequent executions.
@@ -9,27 +13,34 @@ The supported types for `T` are:
9
13
- Can be a user-defined class or struct with read/write properties and a public constructor.
10
14
- Must have one or more simple type properties, including [Boolean].
11
15
12
-
For a detailed explanation, please continue reading [here][readme-background].
16
+
For a detailed explanation of the problem solved by QueryableValues, please continue reading [here][readme-background].
13
17
14
18
## When Should You Use It?
15
19
The `AsQueryableValues` extension method is intended for queries that are dependent upon a *non-constant* sequence of external values. In such cases, the underlying SQL query will be efficient on subsequent executions.
16
20
17
21
It provides a solution to the following long standing [EF Core issue](https://github.com/dotnet/efcore/issues/13617) and enables other currently unsupported scenarios; like the ability to efficiently create joins with in-memory data.
18
22
19
-
## Getting Started
23
+
## Your Support is Appreciated!
24
+
If you feel that this solution has provided you some value, please consider [buying me a ☕][BuyMeACoffee].
25
+
26
+
[![Buy me a coffee][BuyMeACoffeeButton]][BuyMeACoffee]
27
+
28
+
Your ⭐ on [this repository][Repository] also helps! Thanks! 🖖🙂
29
+
30
+
# Getting Started
20
31
21
-
###Installation
32
+
## Installation
22
33
QueryableValues is distributed as a [NuGet Package]. The major version number of this library is aligned with the version of [Entity Framework Core] by which it's supported (e.g. If you are using EF Core 5, then you must use version 5 of QueryableValues).
23
34
24
35
Please choose the appropriate command below to install it using the NuGet Package Manager Console window in Visual Studio:
Look for the place in your code where you are setting up your [DbContext] and calling the [UseSqlServer] extension method, then use a lambda expression to access the `SqlServerDbContextOptionsBuilder` provided by it. It is on this builder that you must call the `UseQueryableValues` extension method as shown in the following simplified examples:
34
45
35
46
When using the `OnConfiguring` method inside your [DbContext]:
@@ -71,15 +82,15 @@ public class Startup
71
82
}
72
83
```
73
84
74
-
###How Do You Use It?
85
+
## How Do You Use It?
75
86
The `AsQueryableValues` extension method is provided by the `BlazarTech.QueryableValues` namespace; therefore, you must add the following `using` directive to your source code file for it to appear as a method of your [DbContext] instance:
76
87
```
77
88
using BlazarTech.QueryableValues;
78
89
```
79
90
80
-
Below are a few examples composing a query using the values provided by an [IEnumerable<T>].
91
+
Below are a few examples composing a query using the values provided by an [IEnumerable<T>].
81
92
82
-
####Simple Type Examples
93
+
### Simple Type Examples
83
94
Using the [Contains][ContainsQueryable] LINQ method:
84
95
85
96
```c#
@@ -108,7 +119,7 @@ var myQuery2 =
108
119
{
109
120
i.MyEntityID,
110
121
i.PropA
111
-
});
122
+
};
112
123
```
113
124
Using the [Join] LINQ method:
114
125
```c#
@@ -136,9 +147,9 @@ var myQuery2 =
136
147
{
137
148
i.MyEntityID,
138
149
i.PropA
139
-
});
150
+
};
140
151
```
141
-
####Complex Type Example
152
+
### Complex Type Example
142
153
```c#
143
154
// Performance Tip:
144
155
// If your IEnumerable<T> item type (T) has many properties, project only
@@ -160,7 +171,7 @@ var myQuery =
160
171
> :warning: There is a limit of up to 10 properties for any given simple type (e.g. cannot have more than 10 [Int32] properties). Exceeding that limit will cause an exception and may also suggest that you should rethink your strategy.
161
172
162
173
## Do You Want To Know More? 📚
163
-
Please take a look at the [repository](https://github.com/yv989c/BlazarTech.QueryableValues).
174
+
Please take a look at the [repository][Repository].
0 commit comments