Exemplo n.º 1
0
        public void Select_WithJson()
        {
            var value = new Playground {
                ArrayOfBytes = new byte[] { 1, 2, 3 }
            };

            connection.Save(value);

            value.ArrayOfBytes[2] = 4;
            connection.Update(value);

            var valueFromDb = connection.Load <Playground>(value.Id);

            Assert.Equal(new byte[] { 1, 2, 4 }, valueFromDb.ArrayOfBytes);
        }
Exemplo n.º 2
0
        public void Select_WithComplexType()
        {
            var value = new Playground {
                Position = new Position {
                    Latitude = 2, Longitude = 3
                }
            };

            connection.Save(value);

            value.Position.Longitude = 4;
            connection.Update(value);

            value = connection.SelectAllFrom <Playground>().Where(x => x.Position.Longitude > 0).FirstOrDefault();
            Assert.Equal(4, value.Position.Longitude);
        }