Here are the examples of the csharp api class Csla.Data.EF4.DbContextManager.AddRef() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
0
1. Example
View licensepublic static DbContextManager<C> GetManager(string database, string label, DbCompiledModel model) { lock (_lock) { var contextLabel = GetContextName(database, label); DbContextManager<C> mgr = null; if (ApplicationContext.LocalContext.Contains(contextLabel)) { mgr = (DbContextManager<C>)(ApplicationContext.LocalContext[contextLabel]); } else { mgr = new DbContextManager<C>(database, label, model, null); mgr.ContextLabel = contextLabel; ApplicationContext.LocalContext[contextLabel] = mgr; } mgr.AddRef(); return mgr; } }
0
2. Example
View licensepublic static DbContextManager<C> GetManager(ObjectContext context, string label) { lock (_lock) { var contextLabel = GetContextName(context.DefaultContainerName, label); DbContextManager<C> mgr = null; if (ApplicationContext.LocalContext.Contains(contextLabel)) { mgr = (DbContextManager<C>)(ApplicationContext.LocalContext[contextLabel]); } else { mgr = new DbContextManager<C>(null, label, null, context); mgr.ContextLabel = contextLabel; ApplicationContext.LocalContext[contextLabel] = mgr; } mgr.AddRef(); return mgr; } }