Ejemplo n.º 1
0
        public void Insert(IPerson item)
        {
            var dbConnection = SqLiteDb.GetConnection();
            var rowsAffected = dbConnection.Execute(@"INSERT INTO Persons ([Id], [Name], [BirthDay], [Age]) values (@Id, @Name, @BirthDay, @Age)",
                                                    new { Id = item.Id.ToString("D"), Name = item.Name, BirthDay = item.BirthDay, Age = item.Age })
            ;

            //return rowsAffected > 0;
        }
Ejemplo n.º 2
0
        public IPerson Find(Guid id)
        {
            var dbConnection = SqLiteDb.GetConnection();
            var result       = dbConnection.Query <Person>("SELECT [Id], [Name], [BirthDay], [Age] FROM [Persons] WHERE Id =@Id ",
                                                           new { Id = id.ToString("D") }).SingleOrDefault();

            return(result);
            //return MapOrderItems(result);
        }