Ejemplo n.º 1
0
        public TheTimeMachineEntity GetById(int id)
        {
            string sql = "select time_machine_id as TimeMachineId, time_machine_name as TimeMachineName from meta_time_machine where Id = ?";

            using (var sqliteConn = connectionProvider.GetConnection())
            {
                return(sqliteConn.QueryFirstOrDefault <TheTimeMachineEntity>(sql, new { Id = id }));
            }
        }
Ejemplo n.º 2
0
        public void Create(MetaTimeMachineEntity entity)
        {
            string sql = "insert into meta_time_machine(time_machine_id, time_machine_name) values (@TimeMachineId, @TimeMachineName);";

            using (var sqliteConn = connectionProvider.GetConnection())
            {
                sqliteConn.Execute(sql, new { TimeMachineId = entity.TimeMachineId, TimeMachineName = entity.TimeMachineName });
            }
        }
        public void Create(PlaceEntity entity)
        {
            string sql = "insert into place(name, longitude, latitude, time_machine_id) values (@Name, @Longitude, @Latitude, @TimeMachineId);";

            using (var sqliteConn = connectionProvider.GetConnection())
            {
                sqliteConn.Execute(sql, new { Name = entity.Name, Longitude = entity.Longitude, Latitude = entity.Latitude, TimeMachineId = entity.TimeMachineId });
            }
        }