Reo.Core.PredicateBuilder.CodeGeneration 8.0.497

dotnet add package Reo.Core.PredicateBuilder.CodeGeneration --version 8.0.497
                    
NuGet\Install-Package Reo.Core.PredicateBuilder.CodeGeneration -Version 8.0.497
                    
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.497" />
                    
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.497" />
                    
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.497
                    
#r "nuget: Reo.Core.PredicateBuilder.CodeGeneration, 8.0.497"
                    
#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.497
                    
#: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.497
                    
Install as a Cake Addin
#tool nuget:?package=Reo.Core.PredicateBuilder.CodeGeneration&version=8.0.497
                    
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.497 0 8/8/2025
8.0.496 0 8/8/2025
8.0.495 0 8/8/2025
8.0.494 29 8/8/2025
8.0.493 41 8/7/2025
8.0.492 39 8/7/2025
8.0.491 39 8/7/2025
8.0.490 40 8/7/2025
8.0.489 46 8/5/2025
8.0.488 44 8/5/2025
8.0.487 53 8/1/2025
8.0.486 85 7/30/2025
8.0.485 94 7/28/2025
8.0.484 87 7/28/2025
8.0.483 85 7/28/2025
8.0.482 84 7/28/2025
8.0.481 83 7/28/2025
8.0.480 343 7/25/2025
8.0.479 369 7/25/2025
8.0.478 370 7/25/2025
8.0.477 379 7/25/2025
8.0.476 382 7/25/2025
8.0.475 436 7/24/2025
8.0.474 433 7/24/2025
8.0.473 485 7/23/2025
8.0.472 482 7/23/2025
8.0.470 483 7/23/2025
8.0.469 486 7/23/2025
8.0.468 482 7/23/2025
8.0.467 480 7/23/2025
8.0.466 484 7/23/2025
8.0.465 482 7/23/2025
8.0.464 482 7/23/2025
8.0.463 484 7/23/2025
8.0.462 477 7/22/2025
8.0.461 474 7/22/2025
8.0.460 364 7/21/2025
8.0.459 42 7/18/2025
8.0.458 75 7/18/2025
8.0.457 110 7/17/2025
8.0.456 113 7/17/2025
8.0.455 109 7/17/2025
8.0.454 108 7/17/2025
8.0.453 105 7/17/2025
8.0.451 106 7/17/2025
8.0.450 108 7/17/2025
8.0.449 109 7/17/2025
8.0.448 110 7/17/2025
8.0.447 109 7/16/2025
8.0.446 107 7/16/2025
8.0.445 114 7/16/2025
8.0.444 111 7/16/2025
8.0.443 111 7/16/2025
8.0.442 108 7/16/2025
8.0.438 110 7/15/2025
8.0.437 114 7/15/2025
8.0.436 106 7/15/2025
8.0.435 111 7/15/2025
8.0.433 126 7/14/2025
8.0.432 126 7/14/2025
8.0.431 109 7/11/2025
8.0.430 114 7/11/2025
8.0.429 142 7/10/2025
8.0.428 129 7/10/2025
8.0.427 132 7/9/2025
8.0.426 128 7/8/2025
8.0.425 132 7/8/2025
8.0.424 136 7/8/2025
8.0.423 133 7/8/2025
8.0.422 135 7/8/2025
8.0.421 135 7/8/2025
8.0.420 129 7/7/2025
8.0.419 127 7/7/2025
8.0.418 126 7/7/2025
8.0.417 129 7/7/2025
8.0.416 130 7/6/2025
8.0.415 86 7/4/2025
8.0.414 102 7/4/2025
8.0.411 133 7/3/2025
8.0.410 127 7/3/2025
8.0.409 129 7/3/2025
8.0.408 126 7/1/2025
8.0.407 130 7/1/2025
8.0.406 132 7/1/2025
8.0.405 135 7/1/2025
8.0.404 130 6/26/2025
8.0.403 127 6/26/2025
8.0.401 131 6/24/2025
8.0.400 134 6/24/2025
8.0.399 129 6/23/2025
8.0.398 129 6/23/2025
8.0.397 90 6/20/2025
8.0.396 131 6/19/2025
8.0.395 131 6/18/2025
8.0.394 130 6/18/2025
8.0.392 133 6/18/2025
8.0.390 130 6/18/2025
8.0.387 134 6/17/2025
8.0.386 140 6/16/2025
8.0.385 129 6/16/2025
8.0.384 137 6/16/2025
8.0.383 138 6/16/2025
8.0.382 134 6/16/2025
8.0.380 277 6/11/2025
8.0.379 279 6/11/2025
8.0.378 267 6/10/2025
8.0.377 256 6/9/2025
8.0.376 258 6/9/2025
8.0.375 261 6/9/2025
8.0.374 232 6/9/2025
8.0.373 213 6/9/2025
8.0.372 216 6/9/2025
8.0.371 73 6/6/2025
8.0.370 86 6/6/2025
8.0.369 113 6/6/2025
8.0.368 113 6/6/2025
8.0.367 136 6/5/2025
8.0.366 136 6/5/2025
8.0.365 139 6/5/2025
8.0.364 143 6/5/2025
8.0.363 135 6/5/2025
8.0.362 134 6/4/2025
8.0.361 136 6/4/2025
8.0.360 129 6/4/2025
8.0.359 137 6/4/2025
8.0.358 136 6/4/2025
8.0.357 132 6/4/2025
8.0.356 131 6/3/2025
8.0.355 135 6/3/2025
8.0.354 134 6/3/2025
8.0.353 140 6/2/2025
8.0.352 133 6/2/2025
8.0.351 139 6/2/2025
8.0.350 140 5/29/2025
8.0.349 137 5/29/2025
8.0.348 139 5/29/2025
8.0.347 156 5/29/2025
8.0.346 139 5/29/2025
8.0.345 138 5/28/2025
8.0.344 133 5/28/2025
8.0.343 142 5/28/2025
8.0.342 136 5/28/2025
8.0.341 137 5/28/2025
8.0.340 140 5/28/2025
8.0.339 137 5/27/2025
8.0.338 139 5/27/2025
8.0.337 138 5/26/2025
8.0.336 114 5/23/2025
8.0.335 110 5/23/2025
8.0.334 117 5/23/2025
8.0.333 139 5/22/2025
8.0.332 134 5/22/2025
8.0.331 133 5/22/2025
8.0.330 138 5/21/2025
6.0.497 0 8/8/2025
6.0.496 0 8/8/2025
6.0.495 0 8/8/2025
6.0.494 26 8/8/2025
6.0.493 40 8/7/2025
6.0.492 36 8/7/2025
6.0.491 37 8/7/2025
6.0.490 37 8/7/2025
6.0.489 44 8/5/2025
6.0.488 45 8/5/2025
6.0.487 52 8/1/2025
6.0.486 83 7/30/2025
6.0.485 85 7/28/2025
6.0.484 86 7/28/2025
6.0.483 83 7/28/2025
6.0.482 83 7/28/2025
6.0.481 84 7/28/2025
6.0.480 339 7/25/2025
6.0.479 370 7/25/2025
6.0.478 368 7/25/2025
6.0.477 376 7/25/2025
6.0.476 381 7/25/2025
6.0.475 430 7/24/2025
6.0.474 430 7/24/2025
6.0.473 483 7/23/2025
6.0.472 483 7/23/2025
6.0.470 480 7/23/2025
6.0.469 479 7/23/2025
6.0.468 479 7/23/2025
6.0.467 479 7/23/2025
6.0.466 482 7/23/2025
6.0.465 478 7/23/2025
6.0.464 479 7/23/2025
6.0.463 478 7/23/2025
6.0.462 473 7/22/2025
6.0.461 472 7/22/2025
6.0.460 358 7/21/2025
6.0.459 38 7/18/2025
6.0.458 69 7/18/2025
6.0.457 104 7/17/2025
6.0.456 108 7/17/2025
6.0.455 104 7/17/2025
6.0.454 105 7/17/2025
6.0.453 107 7/17/2025
6.0.451 107 7/17/2025
6.0.450 104 7/17/2025
6.0.449 103 7/17/2025
6.0.448 104 7/17/2025
6.0.447 103 7/16/2025
6.0.446 104 7/16/2025
6.0.445 110 7/16/2025
6.0.444 107 7/16/2025
6.0.443 106 7/16/2025
6.0.442 107 7/16/2025
6.0.438 109 7/15/2025
6.0.437 106 7/15/2025
6.0.436 104 7/15/2025
6.0.435 105 7/15/2025
6.0.433 124 7/14/2025
6.0.432 128 7/14/2025
6.0.431 104 7/11/2025
6.0.430 112 7/11/2025
6.0.429 131 7/10/2025
6.0.428 129 7/10/2025
6.0.427 130 7/9/2025
6.0.426 125 7/8/2025
6.0.425 130 7/8/2025
6.0.424 128 7/8/2025
6.0.423 128 7/8/2025
6.0.422 126 7/8/2025
6.0.421 128 7/8/2025
6.0.420 127 7/7/2025
6.0.419 122 7/7/2025
6.0.418 123 7/7/2025
6.0.417 124 7/7/2025
6.0.416 123 7/6/2025
6.0.415 87 7/4/2025
6.0.414 92 7/4/2025
6.0.411 129 7/3/2025
6.0.410 124 7/3/2025
6.0.409 127 7/3/2025
6.0.408 124 7/1/2025
6.0.407 123 7/1/2025
6.0.406 127 7/1/2025
6.0.405 125 7/1/2025
6.0.404 125 6/26/2025
6.0.403 129 6/26/2025
6.0.401 126 6/24/2025
6.0.400 129 6/24/2025
6.0.399 129 6/23/2025
6.0.398 134 6/23/2025
6.0.397 92 6/20/2025
6.0.396 133 6/19/2025
6.0.395 128 6/18/2025
6.0.394 137 6/18/2025
6.0.392 130 6/18/2025
6.0.390 129 6/18/2025
6.0.387 132 6/17/2025
6.0.386 131 6/16/2025
6.0.385 133 6/16/2025
6.0.384 130 6/16/2025
6.0.383 132 6/16/2025
6.0.382 128 6/16/2025
6.0.380 277 6/11/2025
6.0.379 278 6/11/2025
6.0.378 264 6/10/2025
6.0.377 260 6/9/2025
6.0.376 255 6/9/2025
6.0.375 260 6/9/2025
6.0.374 234 6/9/2025
6.0.373 215 6/9/2025
6.0.372 214 6/9/2025
6.0.371 71 6/6/2025
6.0.370 85 6/6/2025
6.0.369 111 6/6/2025
6.0.368 107 6/6/2025
6.0.367 137 6/5/2025
6.0.366 137 6/5/2025
6.0.365 135 6/5/2025
6.0.364 141 6/5/2025
6.0.363 131 6/5/2025
6.0.362 132 6/4/2025
6.0.361 136 6/4/2025
6.0.360 129 6/4/2025
6.0.359 141 6/4/2025
6.0.358 138 6/4/2025
6.0.357 132 6/4/2025
6.0.356 134 6/3/2025
6.0.355 137 6/3/2025
6.0.354 136 6/3/2025
6.0.353 135 6/2/2025
6.0.352 140 6/2/2025
6.0.351 137 6/2/2025
6.0.350 144 5/29/2025
6.0.349 140 5/29/2025
6.0.348 141 5/29/2025
6.0.347 136 5/29/2025
6.0.346 136 5/29/2025
6.0.345 136 5/28/2025
6.0.344 137 5/28/2025
6.0.343 137 5/28/2025
6.0.342 136 5/28/2025
6.0.341 141 5/28/2025
6.0.340 137 5/28/2025
6.0.339 138 5/27/2025
6.0.338 136 5/27/2025
6.0.337 139 5/26/2025
6.0.336 107 5/23/2025
6.0.335 112 5/23/2025
6.0.334 120 5/23/2025
6.0.333 136 5/22/2025
6.0.332 135 5/22/2025
6.0.331 136 5/22/2025
6.0.330 137 5/21/2025