All Projects → hazzik → Delegatedecompiler

hazzik / Delegatedecompiler

Licence: mit
A library which is able to decompile a delegate or a method body to its lambda representation

Projects that are alternatives of or similar to Delegatedecompiler

reverse-enginnering
open source repository
Stars: ✭ 29 (-92.7%)
Mutual labels:  decompile
Mockqueryable
Moking Entity Framework Core operations such ToListAsync, FirstOrDefaultAsync etc
Stars: ✭ 281 (-29.22%)
Mutual labels:  entity-framework
Dtcollectionviewmanager
Protocol-oriented UICollectionView management, powered by generics and associated types.
Stars: ✭ 300 (-24.43%)
Mutual labels:  delegate
mysql-dotnet-core
ASP.NET Core 5.0 Web Application using MySQL with Entity Framework
Stars: ✭ 95 (-76.07%)
Mutual labels:  entity-framework
Mspeekcollectionviewdelegateimplementation
A custom paging behavior that peeks the previous and next items in a collection view
Stars: ✭ 265 (-33.25%)
Mutual labels:  delegate
Wasmdec
WebAssembly to C decompiler
Stars: ✭ 290 (-26.95%)
Mutual labels:  decompile
OpenSleigh
OpenSleigh is a Saga management library for .NET Core.
Stars: ✭ 198 (-50.13%)
Mutual labels:  entity-framework
Dotnext
Next generation API for .NET
Stars: ✭ 379 (-4.53%)
Mutual labels:  delegate
Entityframework.exceptions
Handle database errors easily when working with Entity Framework Core. Supports SQLServer, PostgreSQL, SQLite, Oracle and MySql
Stars: ✭ 266 (-33%)
Mutual labels:  entity-framework
Efsecondlevelcache.core
Entity Framework Core Second Level Caching Library
Stars: ✭ 300 (-24.43%)
Mutual labels:  entity-framework
postgresql-dotnet-core
ASP.NET Core 3.1 Web Application using PostgreSQL with Entity Framework
Stars: ✭ 78 (-80.35%)
Mutual labels:  entity-framework
Efdesigner
Entity Framework visual design surface and code-first code generation for EF6, Core and beyond
Stars: ✭ 256 (-35.52%)
Mutual labels:  entity-framework
Knphotobrowser
📷 图片 || 视频 浏览器(本地和网络) , UIViewController + CollectionView , 完美适配 iPhone 以及 iPad ,屏幕旋转功能 , 适配SDWebImage 5.0
Stars: ✭ 296 (-25.44%)
Mutual labels:  delegate
SmartBlock
用Block实现的通知替代方案,并且已实现在不同线程进行发送消息和执行Block,支持多参数传送,解决回调地狱问题,适用于组件化数据传输等。
Stars: ✭ 17 (-95.72%)
Mutual labels:  delegate
Sapphiredb
SapphireDb Server, a self-hosted, easy to use realtime database for Asp.Net Core and EF Core
Stars: ✭ 326 (-17.88%)
Mutual labels:  entity-framework
ASP.NET-Core-2-MVC-CRUD-datatables-jQuery-Plugin
Asp.Net Example implementation of datatables.net using Asp.Net Core 2 Mvc CRUD datatables jQuery Plugin
Stars: ✭ 25 (-93.7%)
Mutual labels:  entity-framework
Pyinstxtractor
PyInstaller Extractor
Stars: ✭ 280 (-29.47%)
Mutual labels:  decompile
Tomb5
Tomb Raider: Chronicles Disassembly translated to C source code.
Stars: ✭ 397 (+0%)
Mutual labels:  decompile
Nein Linq
NeinLinq provides helpful extensions for using LINQ providers such as Entity Framework that support only a minor subset of .NET functions, reusing functions, rewriting queries, even making them null-safe, and building dynamic queries using translatable predicates and selectors.
Stars: ✭ 347 (-12.59%)
Mutual labels:  entity-framework
Anyformatkit
Simple text formatting in Swift
Stars: ✭ 296 (-25.44%)
Mutual labels:  delegate

DelegateDecompiler

A tool which is able to decompile a delegate or a method body to its lambda representation

Examples

Using computed properties in linq.

Asume we have a class with a computed property

class Employee
{
    [Computed]
    public string FullName
    {
        get { return FirstName + " " + LastName; }
    }

    public string LastName { get; set; }

    public string FirstName { get; set; }
}

And you are going to query employees by their full names

var employees = (from employee in db.Employees
                 where employee.FullName == "Test User"
                 select employee).Decompile().ToList();

When you call .Decompile method it decompiles your computed properties to their underlying representation and the query will become simmilar to the following query

var employees = (from employee in db.Employees
                 where (employee.FirstName + " " + employee.LastName)  == "Test User"
                 select employee).ToList();

If your class doesn't have a [Computed] attribute, you can use the .Computed() extension method..

var employees = (from employee in db.Employees
                 where employee.FullName.Computed() == "Test User"
                 select employee).ToList();

Also, you can call methods that return a single item (Any, Count, First, Single, etc) as well as other methods in identical way like this:

bool exists = db.Employees.Decompile().Any(employee => employee.FullName == "Test User");

Again, the FullName property will be decompiled:

bool exists = db.Employees.Any(employee => (employee.FirstName + " " + employee.LastName) == "Test User");

Using with EntityFramework and other ORMs

If you are using ORM specific features, like EF's Include, AsNoTracking or NH's Fetch then Decompile method should be called after all ORM specific methods, otherwise it may not work. Ideally use Decompile extension method just before materialization methods such as ToList, ToArray, First, FirstOrDefault, Count, Any, and etc.

Async Support with EntityFramework 6

The DelegateDecompiler.EntityFramework package provides DecompileAsync extension method which adds support for EF's Async operations.

Async Support with EntityFramework Core 2.0-3.1

The DelegateDecompiler.EntityFrameworkCore package provides DecompileAsync extension method which adds support for EF's Async operations.

Async Support with EntityFramework Core 5.0

The DelegateDecompiler.EntityFrameworkCore5 package provides DecompileAsync extension method which adds support for EF's Async operations.

Installation

Available on NuGet

Donations

If you like the library please support my work.

License

MIT license - http://opensource.org/licenses/mit

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].