joelweiss/ChangeTracking

Get underlying entity object without trackable

Int32Overflow opened this issue · 2 comments

How can I get underlying object without trackable proxy interface?

Hi @Int32Overflow #37

        [Fact]
        public void GetCurrent_Should_Return_Original()
        {
            var order = Helper.GetOrder();
            var trackable = order.AsTrackable();

            trackable.Id = 124;
            trackable.CustomerNumber = "Test1";

            var current = trackable.CastToIChangeTrackable().GetCurrent();

            current.ShouldBeEquivalentTo(trackable);
            (current is IChangeTrackable).Should().BeFalse();
        }

Thank you