Example #1
0
 public bool Equals(UserId c1)
 {
     if (c1 == null)
     {
         return false;
     }
     return this.ToString() == c1.ToString();
 }
Example #2
0
        public static void ContribSelectData(UserId id)
        {
            using (var connection = new System.Data.SQLite.SQLiteConnection(cnStr))
            {
                connection.Open();
                var data = connection.Get<Poco.Users>(id);

                System.Diagnostics.Debug.Assert(id.Equals(data.Id));
            }
        }
Example #3
0
        public static void SelectData(UserId id)
        {
            using (var connection = new System.Data.SQLite.SQLiteConnection(cnStr))
            {
                connection.Open();
                var data = connection.Query<Poco.Users>("SELECT * FROM Users WHERE Id = @Id",
                    new  { Id = id }).FirstOrDefault();

                System.Diagnostics.Debug.Assert(id.Equals(data.Id));
            }
        }
Example #4
0
        private static UserId InsertData()
        {
            var id = new UserId("Abc12c");
            using (var connection = new System.Data.SQLite.SQLiteConnection(cnStr))
            {
                connection.Open();
                connection.Execute("INSERT INTO Users (Id, Age, Name) VALUES (@Id, @Age, @Name)",
                    new {
                        Age = 31,
                        Id = id,
                        Name = "Peter Gill"
                    });
            }

            return id;
        }
Example #5
0
        private static UserId ContribInsertData()
        {
            var id = new UserId("Abc12c");
            using (var connection = new System.Data.SQLite.SQLiteConnection(cnStr))
            {
                connection.Open();
                connection.Insert(new Poco.Users()
                    {
                        Age = 31,
                        Id = id,
                        Name = "Peter Gill"
                    });
            }

            return id;
        }