Ejemplo n.º 1
0
        public void persists_subclass()
        {
            var policy = new LinuxPolicy {
                Name = Guid.NewGuid().ToString()
            };

            using (var session = theStore.LightweightSession())
            {
                session.Store(policy);
                session.SaveChanges();
            }
        }
Ejemplo n.º 2
0
        public void query_for_only_a_subclass_with_where_clause()
        {
            var policy = new LinuxPolicy {
                VersionId = Guid.NewGuid(), Name = Guid.NewGuid().ToString()
            };

            using (var session = theStore.LightweightSession())
            {
                session.Store(policy);
                session.SaveChanges();
            }

            using (var session = theStore.LightweightSession())
            {
                session.Query <IPolicy>().Single(p => p.VersionId == policy.VersionId)
                .VersionId.ShouldBe(policy.VersionId);
            }
        }