Reo.Core.PredicateBuilder.CodeGeneration 8.0.522

dotnet add package Reo.Core.PredicateBuilder.CodeGeneration --version 8.0.522
                    
NuGet\Install-Package Reo.Core.PredicateBuilder.CodeGeneration -Version 8.0.522
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Reo.Core.PredicateBuilder.CodeGeneration" Version="8.0.522" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Reo.Core.PredicateBuilder.CodeGeneration" Version="8.0.522" />
                    
Directory.Packages.props
<PackageReference Include="Reo.Core.PredicateBuilder.CodeGeneration" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Reo.Core.PredicateBuilder.CodeGeneration --version 8.0.522
                    
#r "nuget: Reo.Core.PredicateBuilder.CodeGeneration, 8.0.522"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Reo.Core.PredicateBuilder.CodeGeneration@8.0.522
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Reo.Core.PredicateBuilder.CodeGeneration&version=8.0.522
                    
Install as a Cake Addin
#tool nuget:?package=Reo.Core.PredicateBuilder.CodeGeneration&version=8.0.522
                    
Install as a Cake Tool

Reo.Core.PredicateBuilder.CodeGeneration

Описание пакета

Пакет Reo.Core.PredicateBuilder.CodeGeneration предназначен для автоматической генерации кода, связанного с построением динамических предикатов для LINQ-запросов. Он упрощает создание сложных условий фильтрации данных, часто используемых в приложениях, работающих с базами данных или коллекциями.

Основные функции:

  • Автоматическая генерация расширений методов для построения предикатов.
  • Использование XML-документации для определения параметров и логики фильтрации.
  • Поддержка генерации кода для различных типов данных (например, DateTime, TimeSpan и др.).

Основные компоненты

  • XmlDocTagsParser: Парсит XML-комментарии в исходном коде для извлечения информации о параметрах и условиях фильтрации.
  • ExtensionsClassGenerator: Генерирует классы с расширениями методов, которые позволяют строить LINQ-выражения на основе определённых в XML-документации правил.
  • BaseExtensionSyntax: Обеспечивает проверку и обработку базовых классов, на которых строится генерация кода.
  • ExtensionsSourceOutput: Отвечает за создание и запись сгенерированного кода в файлы проекта.

Требования

  • .NET: Совместим с .NET Standard 2.0 и выше.
  • Зависимости:
    • Microsoft.CodeAnalysis.CSharp (для работы с Roslyn API).

Установка

Используйте следующие команды для установки пакета:

# NuGet Package Manager
Install-Package Reo.Core.PredicateBuilder.CodeGeneration

# .NET CLI
dotnet add package Reo.Core.PredicateBuilder.CodeGeneration

Настройка

Пакет не требует явной регистрации в контейнере DI (например, в ASP.NET Core). Он работает на уровне генерации кода в процессе компиляции проекта.

Примечание: Убедитесь, что в проекте настроены XML-комментарии для методов и свойств, которые будут использоваться в генерации кода.

Использование

Примеры использования:

1. Генерация предикатов для фильтрации данных

Предположим, у вас есть сущность User с свойством Age. С помощью сгенерированного кода можно создать фильтр:

var users = context.Users.Where(user => user.Age.PredicateBuilder.GreaterThan(18));

2. Использование параметров из XML-документации

XML-комментарии в исходном коде могут содержать метаданные, которые будут использованы для генерации:

/// <summary>
/// Фильтрует пользователей по возрасту.
/// </summary>
/// <param name="age">Минимальный возраст.</param>
public static Expression<Func<User, bool>> GreaterThan(int age) { ... }

3. Поддержка нескольких типов данных

Пакет автоматически генерирует код для типов, указанных в _generatedTypes (например, DateTime, TimeSpan, DateOnly, TimeOnly).

Лицензия

Этот пакет распространяется под MIT License. См. файл LICENSE для деталей.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.522 107 8/28/2025
8.0.521 121 8/27/2025
8.0.520 128 8/27/2025
8.0.519 123 8/27/2025
8.0.518 125 8/27/2025
8.0.517 136 8/25/2025
8.0.516 268 8/25/2025
8.0.515 191 8/24/2025
8.0.514 125 8/21/2025
8.0.513 122 8/20/2025
8.0.512 123 8/20/2025
8.0.511 123 8/20/2025
8.0.510 124 8/18/2025
8.0.509 124 8/18/2025
8.0.508 128 8/13/2025
8.0.505 131 8/13/2025
8.0.504 130 8/13/2025
8.0.503 129 8/13/2025
8.0.502 130 8/12/2025
8.0.501 128 8/12/2025
8.0.500 126 8/12/2025
8.0.499 133 8/12/2025
8.0.498 125 8/11/2025
8.0.497 164 8/8/2025
8.0.496 164 8/8/2025
8.0.495 171 8/8/2025
8.0.494 196 8/8/2025
8.0.493 201 8/7/2025
8.0.492 202 8/7/2025
8.0.491 199 8/7/2025
8.0.490 202 8/7/2025
8.0.489 210 8/5/2025
8.0.488 212 8/5/2025
8.0.487 63 8/1/2025
8.0.486 94 7/30/2025
8.0.485 101 7/28/2025
8.0.484 95 7/28/2025
8.0.483 93 7/28/2025
8.0.482 92 7/28/2025
8.0.481 91 7/28/2025
8.0.480 349 7/25/2025
8.0.479 376 7/25/2025
8.0.478 377 7/25/2025
8.0.477 385 7/25/2025
8.0.476 388 7/25/2025
8.0.475 443 7/24/2025
8.0.474 441 7/24/2025
8.0.473 492 7/23/2025
8.0.472 489 7/23/2025
8.0.470 489 7/23/2025
8.0.469 492 7/23/2025
8.0.468 488 7/23/2025
8.0.467 486 7/23/2025
8.0.466 490 7/23/2025
8.0.465 488 7/23/2025
8.0.464 489 7/23/2025
8.0.463 491 7/23/2025
8.0.462 483 7/22/2025
8.0.461 480 7/22/2025
8.0.460 371 7/21/2025
8.0.459 49 7/18/2025
8.0.458 82 7/18/2025
8.0.457 118 7/17/2025
8.0.456 120 7/17/2025
8.0.455 115 7/17/2025
8.0.454 114 7/17/2025
8.0.453 112 7/17/2025
8.0.451 112 7/17/2025
8.0.450 114 7/17/2025
8.0.449 115 7/17/2025
8.0.448 117 7/17/2025
8.0.447 116 7/16/2025
8.0.446 114 7/16/2025
8.0.445 122 7/16/2025
8.0.444 118 7/16/2025
8.0.443 118 7/16/2025
8.0.442 115 7/16/2025
8.0.438 116 7/15/2025
8.0.437 120 7/15/2025
8.0.436 113 7/15/2025
8.0.435 118 7/15/2025
8.0.433 133 7/14/2025
8.0.432 133 7/14/2025
8.0.431 115 7/11/2025
8.0.430 121 7/11/2025
8.0.429 149 7/10/2025
8.0.428 135 7/10/2025
8.0.427 139 7/9/2025
8.0.426 135 7/8/2025
8.0.425 140 7/8/2025
8.0.424 144 7/8/2025
8.0.423 141 7/8/2025
8.0.422 143 7/8/2025
8.0.421 144 7/8/2025
8.0.420 136 7/7/2025
8.0.419 135 7/7/2025
8.0.418 133 7/7/2025
8.0.417 136 7/7/2025
8.0.416 137 7/6/2025
8.0.415 95 7/4/2025
8.0.414 111 7/4/2025
8.0.411 142 7/3/2025
8.0.410 137 7/3/2025
8.0.409 138 7/3/2025
8.0.408 134 7/1/2025
8.0.407 138 7/1/2025
8.0.406 140 7/1/2025
8.0.405 144 7/1/2025
8.0.404 136 6/26/2025
8.0.403 134 6/26/2025
8.0.401 138 6/24/2025
8.0.400 141 6/24/2025
8.0.399 136 6/23/2025
8.0.398 136 6/23/2025
8.0.397 96 6/20/2025
8.0.396 137 6/19/2025
8.0.395 137 6/18/2025
8.0.394 137 6/18/2025
8.0.392 139 6/18/2025
8.0.390 137 6/18/2025
8.0.387 140 6/17/2025
8.0.386 146 6/16/2025
8.0.385 135 6/16/2025
8.0.384 143 6/16/2025
8.0.383 145 6/16/2025
8.0.382 140 6/16/2025
8.0.380 283 6/11/2025
8.0.379 286 6/11/2025
8.0.378 274 6/10/2025
8.0.377 263 6/9/2025
8.0.376 264 6/9/2025
8.0.375 267 6/9/2025
8.0.374 239 6/9/2025
8.0.373 220 6/9/2025
8.0.372 222 6/9/2025
8.0.371 79 6/6/2025
8.0.370 92 6/6/2025
8.0.369 119 6/6/2025
8.0.368 119 6/6/2025
8.0.367 143 6/5/2025
8.0.366 143 6/5/2025
8.0.365 146 6/5/2025
8.0.364 150 6/5/2025
8.0.363 141 6/5/2025
8.0.362 141 6/4/2025
8.0.361 142 6/4/2025
8.0.360 136 6/4/2025
8.0.359 144 6/4/2025
8.0.358 143 6/4/2025
8.0.357 138 6/4/2025
8.0.356 138 6/3/2025
8.0.355 142 6/3/2025
8.0.354 140 6/3/2025
8.0.353 146 6/2/2025
8.0.352 140 6/2/2025
8.0.351 146 6/2/2025
8.0.350 147 5/29/2025
8.0.349 143 5/29/2025
8.0.348 145 5/29/2025
8.0.347 162 5/29/2025
8.0.346 147 5/29/2025
8.0.345 144 5/28/2025
8.0.344 140 5/28/2025
8.0.343 149 5/28/2025
8.0.342 143 5/28/2025
8.0.341 143 5/28/2025
8.0.340 147 5/28/2025
8.0.339 143 5/27/2025
8.0.338 145 5/27/2025
8.0.337 145 5/26/2025
8.0.336 120 5/23/2025
8.0.335 116 5/23/2025
8.0.334 123 5/23/2025
8.0.333 146 5/22/2025
8.0.332 141 5/22/2025
8.0.331 141 5/22/2025
8.0.330 145 5/21/2025
6.0.522 109 8/28/2025
6.0.521 120 8/27/2025
6.0.520 120 8/27/2025
6.0.519 122 8/27/2025
6.0.518 124 8/27/2025
6.0.517 138 8/25/2025
6.0.516 267 8/25/2025
6.0.515 195 8/24/2025
6.0.514 119 8/21/2025
6.0.513 119 8/20/2025
6.0.512 120 8/20/2025
6.0.511 118 8/20/2025
6.0.510 122 8/18/2025
6.0.509 122 8/18/2025
6.0.508 129 8/13/2025
6.0.505 126 8/13/2025
6.0.504 128 8/13/2025
6.0.503 129 8/13/2025
6.0.502 125 8/12/2025
6.0.501 126 8/12/2025
6.0.500 124 8/12/2025
6.0.499 129 8/12/2025
6.0.498 120 8/11/2025
6.0.497 161 8/8/2025
6.0.496 163 8/8/2025
6.0.495 167 8/8/2025
6.0.494 193 8/8/2025
6.0.493 203 8/7/2025
6.0.492 200 8/7/2025
6.0.491 199 8/7/2025
6.0.490 199 8/7/2025
6.0.489 209 8/5/2025
6.0.488 210 8/5/2025
6.0.487 61 8/1/2025
6.0.486 91 7/30/2025
6.0.485 92 7/28/2025
6.0.484 94 7/28/2025
6.0.483 89 7/28/2025
6.0.482 88 7/28/2025
6.0.481 92 7/28/2025
6.0.480 346 7/25/2025
6.0.479 376 7/25/2025
6.0.478 374 7/25/2025
6.0.477 383 7/25/2025
6.0.476 387 7/25/2025
6.0.475 437 7/24/2025
6.0.474 438 7/24/2025
6.0.473 489 7/23/2025
6.0.472 489 7/23/2025
6.0.470 486 7/23/2025
6.0.469 485 7/23/2025
6.0.468 485 7/23/2025
6.0.467 486 7/23/2025
6.0.466 488 7/23/2025
6.0.465 485 7/23/2025
6.0.464 486 7/23/2025
6.0.463 485 7/23/2025
6.0.462 480 7/22/2025
6.0.461 479 7/22/2025
6.0.460 364 7/21/2025
6.0.459 44 7/18/2025
6.0.458 76 7/18/2025
6.0.457 111 7/17/2025
6.0.456 115 7/17/2025
6.0.455 112 7/17/2025
6.0.454 111 7/17/2025
6.0.453 114 7/17/2025
6.0.451 113 7/17/2025
6.0.450 110 7/17/2025
6.0.449 109 7/17/2025
6.0.448 111 7/17/2025
6.0.447 109 7/16/2025
6.0.446 111 7/16/2025
6.0.445 119 7/16/2025
6.0.444 114 7/16/2025
6.0.443 113 7/16/2025
6.0.442 114 7/16/2025
6.0.438 116 7/15/2025
6.0.437 113 7/15/2025
6.0.436 110 7/15/2025
6.0.435 111 7/15/2025
6.0.433 130 7/14/2025
6.0.432 134 7/14/2025
6.0.431 110 7/11/2025
6.0.430 119 7/11/2025
6.0.429 137 7/10/2025
6.0.428 135 7/10/2025
6.0.427 136 7/9/2025
6.0.426 131 7/8/2025
6.0.425 138 7/8/2025
6.0.424 136 7/8/2025
6.0.423 136 7/8/2025
6.0.422 134 7/8/2025
6.0.421 135 7/8/2025
6.0.420 135 7/7/2025
6.0.419 130 7/7/2025
6.0.418 131 7/7/2025
6.0.417 131 7/7/2025
6.0.416 131 7/6/2025
6.0.415 98 7/4/2025
6.0.414 102 7/4/2025
6.0.411 139 7/3/2025
6.0.410 133 7/3/2025
6.0.409 136 7/3/2025
6.0.408 132 7/1/2025
6.0.407 131 7/1/2025
6.0.406 135 7/1/2025
6.0.405 133 7/1/2025
6.0.404 132 6/26/2025
6.0.403 135 6/26/2025
6.0.401 132 6/24/2025
6.0.400 135 6/24/2025
6.0.399 135 6/23/2025
6.0.398 140 6/23/2025
6.0.397 98 6/20/2025
6.0.396 139 6/19/2025
6.0.395 135 6/18/2025
6.0.394 143 6/18/2025
6.0.392 137 6/18/2025
6.0.390 136 6/18/2025
6.0.387 139 6/17/2025
6.0.386 138 6/16/2025
6.0.385 139 6/16/2025
6.0.384 136 6/16/2025
6.0.383 138 6/16/2025
6.0.382 135 6/16/2025
6.0.380 283 6/11/2025
6.0.379 285 6/11/2025
6.0.378 272 6/10/2025
6.0.377 267 6/9/2025
6.0.376 262 6/9/2025
6.0.375 268 6/9/2025
6.0.374 242 6/9/2025
6.0.373 222 6/9/2025
6.0.372 221 6/9/2025
6.0.371 78 6/6/2025
6.0.370 92 6/6/2025
6.0.369 118 6/6/2025
6.0.368 114 6/6/2025
6.0.367 144 6/5/2025
6.0.366 144 6/5/2025
6.0.365 141 6/5/2025
6.0.364 147 6/5/2025
6.0.363 137 6/5/2025
6.0.362 139 6/4/2025
6.0.361 142 6/4/2025
6.0.360 136 6/4/2025
6.0.359 147 6/4/2025
6.0.358 145 6/4/2025
6.0.357 138 6/4/2025
6.0.356 140 6/3/2025
6.0.355 144 6/3/2025
6.0.354 142 6/3/2025
6.0.353 141 6/2/2025
6.0.352 146 6/2/2025
6.0.351 144 6/2/2025
6.0.350 150 5/29/2025
6.0.349 146 5/29/2025
6.0.348 148 5/29/2025
6.0.347 142 5/29/2025
6.0.346 143 5/29/2025
6.0.345 143 5/28/2025
6.0.344 143 5/28/2025
6.0.343 143 5/28/2025
6.0.342 143 5/28/2025
6.0.341 148 5/28/2025
6.0.340 143 5/28/2025
6.0.339 145 5/27/2025
6.0.338 142 5/27/2025
6.0.337 145 5/26/2025
6.0.336 114 5/23/2025
6.0.335 118 5/23/2025
6.0.334 126 5/23/2025
6.0.333 144 5/22/2025
6.0.332 142 5/22/2025
6.0.331 144 5/22/2025
6.0.330 144 5/21/2025