GithubHelp home page GithubHelp logo

petrovsergey / slant.entity Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonnynovikov/slant.entity

0.0 1.0 0.0 68 KB

Better Entity Framework development

License: MIT License

C# 99.39% Batchfile 0.61%

slant.entity's Introduction

Slant library for Entity Framework

Join the chat at https://gitter.im/slantdotnet/Slant.Entity NuGet version (Slant.Entity) Build Status GitHub license

Overview

There are two namespaces which contain ready-to-use classes.

####Slant.Linq

It is a free set of extensions for LINQ and Entity Framework power users. It comprises the following:

  • An extensible implementation of AsExpandable()
  • A public expression visitor base class (ExpressionVisitor)
  • PredicateBuilder
  • Linq.Expr and Linq.Func shortcut methods

With Slant.Linq, you can:

  • Plug expressions into EntitySets and EntityCollections
  • Use expression variables in subqueries
  • Combine expressions (have one expression call another)
  • Dynamically build predicates
  • Leverage AsExpandable to add your own extensions.

####Slant.Entity

It provides simple and flexible way to manage your Entity Framework DbContext instances.

DbContextScope was created out of the need for a better way to manage DbContext instances in Entity Framework-based applications.

The commonly advocated method of injecting DbContext instances works fine for single-threaded web applications where each web request implements exactly one business transaction. But it breaks down quite badly when console apps, Windows Services, parallelism and requests that need to implement multiple independent business transactions make their appearance.

The alternative of manually instantiating DbContext instances and manually passing them around as method parameters is (speaking from experience) more than cumbersome.

DbContextScope implements the ambient context pattern for DbContext instances.

It's something that NHibernate users or anyone who has used the TransactionScope class to manage ambient database transactions will be familiar with.

It doesn't force any particular design pattern or application architecture to be used. It works beautifully with dependency injection.

And it works beautifully without. It of course works perfectly with async execution flows, including with the new async / await support introduced in .NET 4.5 and EF6.

And most importantly, at the time of writing, DbContextScope has been battle-tested in a large-scale applications for a long time.

Installation

We recommended installing the NuGet package. Install on the command line from your solution directory or use the Package Manager console in Visual Studio:

PM> Install-Package NSpectator

Usage

Check out our wiki to see typical and non-trivial usages and detailed examples:

Using LINQ Extensions

Using DbContextScope

Contributing

Check out this wiki page for complete guide.

Thanks to

Jetbrains Community Support for providing great tools for our team

Jetbrains Resharper

slant.entity's People

Contributors

jonny-novikov avatar stephentoub avatar gitter-badger avatar

Watchers

Sergey Petrov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.