public void ShouldGetObjectById() { int circleId; using (var session = _store.CreateSession()) { var circle = new Circle { Radius = 10 }; session.Save(circle); session.Flush(); circleId = circle.Id; } using (var session = _store.CreateSession()) { var circle = session.Get<object>(circleId); Assert.NotNull(circle); Assert.Equal(typeof(Circle), circle.GetType()); } }
public async Task ShouldGetObjectById() { int circleId; using (var session = _store.CreateSession()) { var circle = new Circle { Radius = 10 }; session.Save(circle); await session.CommitAsync(); circleId = circle.Id; } using (var session = _store.CreateSession()) { var circle = await session.GetAsync<Circle>(circleId); Assert.NotNull(circle); Assert.Equal(typeof(Circle), circle.GetType()); } }