Git Product home page Git Product logo

entityframework.interceptorex's Introduction

EntityFramework.InterceptorEx

Build status

⚠️⚠️⚠️ It requires more tests

INTRODUCTION

To Install via NuGet

Install-Package EntityFramework.InterceptorEx

NoLock Interceptor

To Register

static DbContextConstructor()
{
    DbInterception.Add(new WithNoLockInterceptor());
}

To Disable

WithNoLockInterceptor.Suppress = true;

To Debug Sql Query

string sql = WithNoLockInterceptor.CommandText

Sample Sql Query Output

SELECT [Extent1].[BlogId] AS [BlogId], [Extent1].[Name] AS [Name]  
       FROM [dbo].[Blogs] AS [Extent1] WITH (NOLOCK)  
       WHERE [Extent1].[Name] LIKE N'Lo%'

Transaction Interceptor

To Register

static DbContextConstructor()
{
    DbInterception.Add(new WithTransactionInterceptor());
}

To Disable

WithTransactionInterceptor.Suppress = true;

Sample Sql Query Output

DECLARE @errorCode INT

BEGIN TRAN

SELECT [Extent1].[BlogId] AS [BlogId], [Extent1].[Name] AS [Name]  
       FROM [dbo].[Blogs] AS [Extent1] WITH (NOLOCK)  
       WHERE [Extent1].[Name] LIKE N'Lo%'

SELECT
	@errorCode = @@ERROR
    IF (@errorCode <> 0) GOTO ERR_HANDLE_BLOCK
    COMMIT TRAN

      ERR_HANDLE_BLOCK:    IF (@errorCode <> 0) BEGIN
        ROLLBACK TRAN
END

Bugs

If you encounter a bug, performance issue, or malfunction, please add an Issue with steps on how to reproduce the problem.

TODO

  • Add more tests
  • Add more documentation

License

Code and documentation are available according to the MIT License (see LICENSE).

entityframework.interceptorex's People

Contributors

bugthesystem avatar ocinbat avatar

Watchers

 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.