本文整理汇总了C#中ITransactionManager类的典型用法代码示例。如果您正苦于以下问题:C# ITransactionManager类的具体用法?C# ITransactionManager怎么用?C# ITransactionManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITransactionManager类属于命名空间,在下文中一共展示了ITransactionManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataRecipeHandler
public DataRecipeHandler(ICoeveryServices coeveryServices, ITransactionManager transactionManager)
{
_coeveryServices = coeveryServices;
_transactionManager = transactionManager;
Logger = NullLogger.Instance;
T = NullLocalizer.Instance;
}
示例2: SpamFilterPartHandler
public SpamFilterPartHandler(
IRepository<SpamFilterPartRecord> repository,
ITransactionManager transactionManager,
ISpamService spamService
) {
_transactionManager = transactionManager;
_spamService = spamService;
Filters.Add(StorageFilter.For(repository));
OnCreating<SpamFilterPart>((context, part) => {
part.Status = _spamService.CheckForSpam(part);
});
OnPublishing<SpamFilterPart>((context, part) => {
if (part.Status == SpamStatus.Spam) {
if (part.Settings.GetModel<SpamFilterPartSettings>().DeleteSpam) {
_transactionManager.Cancel();
}
context.Cancel = true;
}
});
}
示例3: SagePayService
public SagePayService(ITransactionManager transactionManager, ICartSessionManager cartSessionManager, IGetUserGuid getUserGuid, ICartGuidResetter cartGuidResetter)
{
_transactionManager = transactionManager;
_cartSessionManager = cartSessionManager;
_getUserGuid = getUserGuid;
_cartGuidResetter = cartGuidResetter;
}
示例4: DataRecipeHandler
public DataRecipeHandler(IOrchardServices orchardServices, ITransactionManager transactionManager, IRecipeJournal recipeJournal) {
_orchardServices = orchardServices;
_transactionManager = transactionManager;
_recipeJournal = recipeJournal;
Logger = NullLogger.Instance;
T = NullLocalizer.Instance;
}
示例5: Init
public void Init(IEnumerable<Type> dataMigrations) {
var builder = new ContainerBuilder();
_folders = new StubFolders();
var contentDefinitionManager = new Mock<IContentDefinitionManager>().Object;
builder.RegisterInstance(new ShellSettings { DataTablePrefix = "TEST_"});
builder.RegisterType<SqlServerDataServicesProvider>().As<IDataServicesProvider>();
builder.RegisterType<DataServicesProviderFactory>().As<IDataServicesProviderFactory>();
builder.RegisterType<NullInterpreter>().As<IDataMigrationInterpreter>();
builder.RegisterInstance(_folders).As<IExtensionFolders>();
builder.RegisterInstance(contentDefinitionManager).As<IContentDefinitionManager>();
builder.RegisterType<ExtensionManager>().As<IExtensionManager>();
builder.RegisterType<DataMigrationManager>().As<IDataMigrationManager>();
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<StubParallelCacheContext>().As<IParallelCacheContext>();
builder.RegisterType<StubAsyncTokenProvider>().As<IAsyncTokenProvider>();
_session = _sessionFactory.OpenSession();
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>().As<ITransactionManager>();
foreach(var type in dataMigrations) {
builder.RegisterType(type).As<IDataMigration>();
}
_container = builder.Build();
_container.Resolve<IExtensionManager>();
_dataMigrationManager = _container.Resolve<IDataMigrationManager>();
_repository = _container.Resolve<IRepository<DataMigrationRecord>>();
_transactionManager = _container.Resolve<ITransactionManager>();
InitDb();
}
示例6: Init
public void Init() {
_session = _sessionFactory.OpenSession();
foreach (var killType in new[] { typeof(ContentTypeDefinitionRecord), typeof(ContentPartDefinitionRecord), typeof(ContentFieldDefinitionRecord) }) {
foreach (var killRecord in _session.CreateCriteria(killType).List()) {
_session.Delete(killRecord);
}
}
_session.Flush();
_session.Close();
_session.Dispose();
_session = _sessionFactory.OpenSession();
var builder = new ContainerBuilder();
builder.RegisterAutoMocking();
builder.RegisterType<ContentDefinitionManager>().As<IContentDefinitionManager>();
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
builder.RegisterType(typeof(SettingsFormatter)).As(typeof(ISettingsFormatter));
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<StubParallelCacheContext>().As<IParallelCacheContext>();
_session = _sessionFactory.OpenSession();
builder.RegisterInstance(_transactionManager = new TestTransactionManager(_session)).As<ITransactionManager>();
_container = builder.Build();
}
示例7: MembershipService
public MembershipService(IWebsite website, IMemberDao memberDao, IRoleDao roleDao, ITransactionManager transactionManager)
{
this._website = website;
this._memberDao = memberDao;
this._roleDao = roleDao;
this._transactionManager = transactionManager;
}
示例8: FileManagerService
public FileManagerService(IWebsite website, IFileStorage fileStorage, IStorageItemRepository storageItemRepository, ITransactionManager transactionManager)
{
this._fileStorage = fileStorage;
this._website = website;
this._transactionManager = transactionManager;
this._storageItemRepository = storageItemRepository;
}
示例9: ImageService
public ImageService(IWebsite website, IImageStorage imageStorage, IImageRepository imageRepository, ITransactionManager transactionManager)
{
this._website = website;
this._imageStorage = imageStorage;
this._imageRepository = imageRepository;
this._transactionManager = transactionManager;
}
示例10: PageProvider
public PageProvider(ITransactionManager trans, IRepository<SubSite> repoSite, IRepository<WebPage> repoPage, IRepository<WebPageWidget> repoControl)
{
this.trans = trans;
this.repoSite = repoSite;
this.repoPage = repoPage;
this.repoControl = repoControl;
}
示例11: Init
public override void Init() {
base.Init();
_distributedLockService = _container.Resolve<DistributedLockService>();
_applicationEnvironment = (StubApplicationEnvironment)_container.Resolve<IApplicationEnvironment>();
_distributedLockRepository = _container.Resolve<IRepository<DistributedLockRecord>>();
_transactionManager = _container.Resolve<ITransactionManager>();
}
示例12: TestObject
public TestObject(ILifecycleManager lifecycleManager, IObjectPersistor persistor, INakedObjectAdapter nakedObjectAdapter, ITestObjectFactory factory, ITransactionManager transactionManager)
: base(factory) {
this.lifecycleManager = lifecycleManager;
this.persistor = persistor;
this.transactionManager = transactionManager;
NakedObject = nakedObjectAdapter;
}
示例13: SessionLocator
public SessionLocator(
ISessionFactoryHolder sessionFactoryHolder,
ITransactionManager transactionManager) {
_sessionFactoryHolder = sessionFactoryHolder;
_transactionManager = transactionManager;
Logger = NullLogger.Instance;
}
示例14: PerTransactionLifestyleManagerBase
public PerTransactionLifestyleManagerBase(ITransactionManager manager)
{
Contract.Requires(manager != null);
Contract.Ensures(_Manager != null);
_Logger.Debug("created");
_Manager = manager;
}
示例15: DatabaseSession
internal DatabaseSession(IDatabaseCommandFactory databaseCommandFactory, ITransactionManager transactionManager, IDatabaseReaderFactory databaseReaderFactory, IConnectionHandler connectionHandler)
{
_databaseCommandFactory = databaseCommandFactory;
_transactionManager = transactionManager;
_databaseReaderFactory = databaseReaderFactory;
_connectionHandler = connectionHandler;
}