本文整理汇总了C#中Application.IsTransient方法的典型用法代码示例。如果您正苦于以下问题:C# Application.IsTransient方法的具体用法?C# Application.IsTransient怎么用?C# Application.IsTransient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application.IsTransient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConstructorTest
public void ConstructorTest()
{
Application target = new Application();
Assert.IsNotNull(target);
Assert.IsTrue(target.IsTransient());
}
示例2: SaveDeleteApplication
public void SaveDeleteApplication()
{
Application target = new Application();
target.AppliedPosition = NHibernateHelper.DaoFactory.GetPositionDao().GetById(StaticProperties.ExistingPositionID, false);
target.AssociatedProfile = NHibernateHelper.DaoFactory.GetProfileDao().GetById(StaticProperties.ExistingProfileID, false);
//target.ReferSource = NHibernateHelper.DaoFactory.GetReferSourceDao().GetUniqueByExample(new ReferSource("Internet"));
target.Email = StaticProperties.TestString;
target.LastUpdated = DateTime.Now;
target.Submitted = false;
Assert.IsTrue(ValidateBO<Application>.isValid(target));
Assert.IsTrue(target.IsTransient());
using (var ts = new TransactionScope())
{
target = NHibernateHelper.DaoFactory.GetApplicationDao().SaveOrUpdate(target);
ts.CommitTransaction();
}
Assert.IsFalse(target.IsTransient());
Application targetDB = NHibernateHelper.DaoFactory.GetApplicationDao().GetById(target.ID, false);
Assert.AreEqual<Application>(target, targetDB);
this.TestContext.WriteLine("Application Created had ID = {0}", target.ID);
using (var ts = new TransactionScope())
{
NHibernateHelper.DaoFactory.GetApplicationDao().Delete(target);
ts.CommitTransaction();
}
//Make sure it is deleted
bool isDeleted = false;
try
{
target = NHibernateHelper.DaoFactory.GetApplicationDao().GetById(targetDB.ID, false);
target.IsTransient();
}
catch (NHibernate.ObjectNotFoundException)
{
isDeleted = true;
}
Assert.IsTrue(isDeleted);
}