Esempio n. 1
0
        public void Sanity()
        {
            var complexId = new ComplexId
                                {
                                    Id1 = "stringId",
                                    Id2 = Guid.NewGuid(),
                                    Id3 = 25,
                                };

            var entity = new EntityWithComplexId
                             {
                                 Id = complexId,

                                 Property1 = "Property Value 1",
                                 Property2 = "Property Value 2",
                             };
            Session.Save(entity);
            Session.Flush();
            Session.Clear();

            var entity2 = Session.Get<EntityWithComplexId>(complexId);

            Assert.That(entity2, Is.Not.Null);
            Assert.That(entity2.Id, Is.EqualTo(complexId));
        }
Esempio n. 2
0
 public bool Equals(ComplexId other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.Id1, Id1) && other.Id2.Equals(Id2) && other.Id3 == Id3;
 }