Exemplo n.º 1
0
        public void Insert(SQLiteConnection connection, int numberOfUsers)
        {
            var r = new Random();
            for (var i = 0; i < numberOfUsers; i++)
            {
                var user = new SimpleUser
                {
                    FirstName = "First" + i,
                };

                Users.Add(user);

                connection.Insert(user);
            }
        }
        public void Insert(SQLiteConnection connection, int numberOfUsers)
        {
            var r = new Random();

            for (var i = 0; i < numberOfUsers; i++)
            {
                var user = new SimpleUser
                {
                    FirstName = "First" + i,
                };

                Users.Add(user);

                connection.Insert(user);
            }
        }
        public async Task Insert_row_with_auto_incremet()
        {
            var table = new SimpleUserTable();
            table.Create(_connection);
            var expected = new SimpleUser() { FirstName = "Arne"};

            await _connection.InsertAsync(expected);

            var actual = await _connection.FirstAsync<SimpleUser>(new { expected.Id });
            actual.FirstName.Should().Be(expected.FirstName);
            actual.Id.Should().Be(expected.Id);
        }