|
using System.Data.EntityClient;
namespace BackEnd
{
internal static class EntityConnectionScopeHelper
{
/// <summary>
/// If we are in a ConnectionScope we return that (open) connection, otherwise a new closed one
/// </summary>
/// <returns>EnityConnection</returns>
internal static EntityConnection GetEntityConnection()
{
if (EntityConnectionScope.Current != null)
{
return EntityConnectionScope.Current.EntityConnection;
}
else
{
return new EntityConnection(Configuration.EFConnectionStringName);
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Born and living in Vienna, Austria. Started with Pascal in 1993 and MS-DOS 5.0. After that a little C++ in OS/2 and loads of VBA with Access in Windows 95,98, NT. To get more professionel I started C# in 2002 and did some MCP exams on that. After working for my own company I got hired by different companies. Currently I'm employed at the Federal Chambers of Commerce as a Senior Software Engineer.