public void GuidInWhereClause()
        {
            Guid      val   = new Guid("{01234567-abcd-abcd-abcd-0123456789ab}");
            GuidClass basic = new GuidClass();

            using (ISession s = OpenSession())
            {
                basic.Id        = 1;
                basic.GuidValue = val;

                s.Save(basic);
                s.Flush();
            }

            using (ISession s = OpenSession())
            {
                basic = (GuidClass)s.CreateCriteria(typeof(GuidClass))
                        .Add(Expression.Eq("GuidValue", val))
                        .UniqueResult();

                Assert.IsNotNull(basic);
                Assert.AreEqual(1, basic.Id);
                Assert.AreEqual(val, basic.GuidValue);

                s.Delete(basic);
                s.Flush();
            }
        }
		public void GuidInWhereClause()
		{
			Guid val = new Guid("{01234567-abcd-abcd-abcd-0123456789ab}");
			GuidClass basic = new GuidClass();

			using (ISession s = OpenSession())
			{
				basic.Id = 1;
				basic.GuidValue = val;

				s.Save(basic);
				s.Flush();
			}

			using (ISession s = OpenSession())
			{
				basic = (GuidClass)s.CreateCriteria(typeof(GuidClass))
														.Add(Expression.Eq("GuidValue", val))
														.UniqueResult();

				Assert.IsNotNull(basic);
				Assert.AreEqual(1, basic.Id);
				Assert.AreEqual(val, basic.GuidValue);

				s.Delete(basic);
				s.Flush();
			}
		}
		public void ReadWrite()
		{
			Guid val = new Guid("{01234567-abcd-abcd-abcd-0123456789ab}");

			GuidClass basic = new GuidClass();
			basic.Id = 1;
			basic.GuidValue = val;

			ISession s = OpenSession();
			s.Save(basic);
			s.Flush();
			s.Close();

			s = OpenSession();
			basic = (GuidClass)s.Load(typeof(GuidClass), 1);

			Assert.AreEqual(val, basic.GuidValue);

			s.Delete(basic);
			s.Flush();
			s.Close();
		}
        public void ReadWrite()
        {
            Guid val = new Guid("{01234567-abcd-abcd-abcd-0123456789ab}");

            GuidClass basic = new GuidClass();

            basic.Id        = 1;
            basic.GuidValue = val;

            ISession s = OpenSession();

            s.Save(basic);
            s.Flush();
            s.Close();

            s     = OpenSession();
            basic = (GuidClass)s.Load(typeof(GuidClass), 1);

            Assert.AreEqual(val, basic.GuidValue);

            s.Delete(basic);
            s.Flush();
            s.Close();
        }
Beispiel #5
0
        public async Task ReadWriteAsync()
        {
            Guid val = new Guid("{01234567-abcd-abcd-abcd-0123456789ab}");

            GuidClass basic = new GuidClass();

            basic.Id        = 1;
            basic.GuidValue = val;

            ISession s = OpenSession();

            await(s.SaveAsync(basic));
            await(s.FlushAsync());
            s.Close();

            s     = OpenSession();
            basic = (GuidClass)await(s.LoadAsync(typeof(GuidClass), 1));

            Assert.AreEqual(val, basic.GuidValue);

            await(s.DeleteAsync(basic));
            await(s.FlushAsync());
            s.Close();
        }