All Projects → 6bee → Remote.linq

6bee / Remote.linq

Licence: mit
Simply LINQ your remote resources...

Projects that are alternatives of or similar to Remote.linq

Beetle.js
🪲 Javascript ORM, manage your data easily.
Stars: ✭ 53 (-61.03%)
Mutual labels:  linq, entity-framework, entity
EFSqlTranslator
A standalone linq to sql translator that can be used with EF and Dapper.
Stars: ✭ 51 (-62.5%)
Mutual labels:  linq, entity-framework
SpaceWar-ECS
A space war game made with ECS and JobSystem in Unity.
Stars: ✭ 26 (-80.88%)
Mutual labels:  entity-framework, entity
Gridify
Easy and optimized way to apply Filtering, Sorting, and Pagination using text-based data.
Stars: ✭ 372 (+173.53%)
Mutual labels:  linq, entity-framework
LinqBuilder
LinqBuilder is an advanced implementation of the specification pattern specifically targeting LINQ query generation.
Stars: ✭ 34 (-75%)
Mutual labels:  linq, entity-framework
Entitas Cpp
Entitas++ is a fast Entity Component System (ECS) C++11 port of Entitas C#
Stars: ✭ 229 (+68.38%)
Mutual labels:  entity-framework, entity
Linq2db.entityframeworkcore
Bring power of Linq To DB to Entity Framework Core projects
Stars: ✭ 166 (+22.06%)
Mutual labels:  entity-framework, linq
Entitas Csharp
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
Stars: ✭ 5,393 (+3865.44%)
Mutual labels:  entity-framework, entity
Model
Ruby persistence framework with entities and repositories
Stars: ✭ 399 (+193.38%)
Mutual labels:  entity-framework, entity
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 (+155.15%)
Mutual labels:  entity-framework, linq
Sapphiredb
SapphireDb Server, a self-hosted, easy to use realtime database for Asp.Net Core and EF Core
Stars: ✭ 326 (+139.71%)
Mutual labels:  entity-framework, entity
Ecs Snake
Simple snake game powered by ecs framework.
Stars: ✭ 41 (-69.85%)
Mutual labels:  entity-framework, entity
System.linq.dynamic.core
The .NET Standard / .NET Core version from the System Linq Dynamic functionality.
Stars: ✭ 864 (+535.29%)
Mutual labels:  entity-framework, linq
Linq.translations
Declare properties on an object that can be translated by LINQ
Stars: ✭ 51 (-62.5%)
Mutual labels:  entity-framework, linq
Ffplayout Engine
python and ffmpeg based playout
Stars: ✭ 128 (-5.88%)
Mutual labels:  streaming
Android Remote Debugger
A library for remote logging, database debugging, shared preferences and network requests
Stars: ✭ 132 (-2.94%)
Mutual labels:  remote
Confluence
Torrent client as a HTTP service
Stars: ✭ 126 (-7.35%)
Mutual labels:  streaming
Mass Rat
Basic Multiplatform Remote Administration Tool - Xamarin
Stars: ✭ 127 (-6.62%)
Mutual labels:  remote
Webserial
Remote Serial monitor for ESP8266 & ESP32
Stars: ✭ 133 (-2.21%)
Mutual labels:  remote
Neko
A self hosted virtual browser (rabb.it clone) that runs in docker.
Stars: ✭ 1,957 (+1338.97%)
Mutual labels:  streaming

Remote.Linq

branch AppVeyor Travis CI Codecov.io Codacy CodeFactor License
main AppVeyor Build Status Travis Build Status codecov Codacy CodeFactor GitHub license
package nuget myget
Remote.Linq NuGet Badge MyGet Pre Release
Remote.Linq.Async.Queryable MyGet Pre Release
Remote.Linq.EntityFramework NuGet Badge MyGet Pre Release
Remote.Linq.EntityFrameworkCore NuGet Badge MyGet Pre Release
Remote.Linq.Newtonsoft.Json NuGet Badge MyGet Pre Release
Remote.Linq.protobuf-net MyGet Pre Release

Description

Remote Linq is a small and easy to use - yet very powerful - library to translate LINQ expression trees to strongly typed, serializable expression trees and vice versa. It provides functionality to send arbitrary LINQ queries to a remote service to be applied and executed against any enumerable or queryable data collection.

Building a LINQ interface for custom services is made a breeze by using Remote Linq.

Features

  • Translate LINQ expressions into serializable expression trees (remote LINQ expression) and vice versa.
  • Build remote single-type query services (paging, sorting, filtering)
  • Build remote complex LINQ query services (arbitrary LINQ query including joins, groupings, aggregations, projections, etc.)

Scope

In contrast to re-linq, this project enables serialization and deserialization of expression trees and applying LINQ expressions to other LINQ providers e.g. linq-to-object, linq-to-entity, etc.

Remote.Linq makes it super easy to implement a service allowing LINQ queries defined on a client to be executed on a remote server.

Write operations (insert/update/delete) have to be implemented by other means if needed. InfoCarrier.Core might be interesting for such scenarios.

Sample

Client Implement a repository class to set-up server connection and expose the queryable data sets (IQueryable<>)

public class ClientDataRepository
{
    private readonly Func<Expression, DynamicObject> _dataProvider;

    public RemoteRepository(string uri)
    {
        _dataProvider = expression =>
            {
                // setup service connectivity
                using IQueryService service = CreateServerConnection(uri);
                // send expression to service and get back results
                DynamicObject result = service.ExecuteQuery(expression);
                return result;
            };
    }

    public IQueryable<Blog> Blogs => RemoteQueryable.Factory.CreateQueryable<Blog>(_dataProvider);
   
    public IQueryable<Post> Posts => RemoteQueryable.Factory.CreateQueryable<Post>(_dataProvider);
   
    public IQueryable<User> Users => RemoteQueryable.Factory.CreateQueryable<User>(_dataProvider);
}

Use your repository to compose LINQ query and let the data be retrieved from the backend service

var repository = new ClientDataRepository("https://myserver/queryservice");

var myBlogPosts = (
    from blog in repository.Blogs
    from post in blog.Posts
    join owner in repository.Users on blog.OwnerId equals owner.Id
    where owner.login == "hi-its-me"
    select new 
    {
        post.Title,
        post.Date,
        Preview = post.Text.Substring(0, 50)
    }).ToList();

Server Implement the backend service to handle the client's query expression by applying it to a data source e.g. an ORM

public interface IQueryService : IDisposable
{
    DynamicObject ExecuteQuery(Expression queryExpression);
}

public class QueryService : IQueryService
{
    // any linq provider e.g. entity framework, nhibernate, ...
    private IDataProvider _datastore = new ObjectRelationalMapper();

    // you need to be able to retrieve an IQueryable by type
    private Func<Type, IQueryable> _queryableProvider = type => _datastore.GetQueryableByType(type);

    public DynamicObject ExecuteQuery(Expression queryExpression)
    {
        // `Execute` is an extension method provided by Remote.Linq
        // it applies an expression to a data source and returns the result
        return queryExpression.Execute(queryableProvider: _queryableProvider);
    }

    public void Dispose() => _datastore.Dispose();
}

Remote.Linq.EntityFramework / Remote.Linq.EntityFrameworkCore

Remote linq extensions for entity framework and entity framework core.

Use this package when using features specific to EF6 and EF Core:

  • Apply eager-loading (Include-expressions)

  • Make use of DB functions e.g. queryable.Where(x => Microsoft.EntityFrameworkCore.EF.Functions.Like(x.Name, "%fruit%"))

Sample

Client Query blogs including posts and owner

using var repository = new RemoteRepository();
var blogs = repository.Blogs
    .Include("Posts")
    .Include("Owner")
    .ToList();

Server Execute query on database via EF Core

public DynamicObject ExecuteQuery(Expression queryExpression)
{
    using var dbContext = new DbContext();
    return queryExpression.ExecuteWithEntityFrameworkCore(dbContext);
}

Remote.Linq.Newtonsoft.Json

Provides Json.NET serialization settings for Remote.Linq types.

Sample

public TExpression DeepCopy<TExpression>(TExpression expression)
    where TExpression : Remote.Linq.Expressions.Expression
{
    JsonSerializerSettings serializerSettings = new JsonSerializerSettings().ConfigureRemoteLinq(); 
    string json = JsonConvert.SerializeObject(expression, serializerSettings); 
    TExpression copy = JsonConvert.DeserializeObject<TExpression>(json, serializerSettings); 
    return copy;
}
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].