private static WatchlistBE PopulateWatchlist(IDataRecord dr) { WatchlistBE watch = new WatchlistBE(); watch.UserID = DbUtils.Convert.To<uint>(dr["wl_user"], 0); watch.Title = Title.FromDbPath((NS)DbUtils.Convert.To<uint>(dr["wl_namespace"]).Value, GetUTF8String(dr, "wl_title"), null); return watch; }
public static void InsertDWWatch(WatchlistBE watch) { MediaWikiConverterContext.Current.DWCatalog.NewQuery(String.Format("REPLACE into watchlist (wl_user, wl_namespace, wl_title) VALUES ({0}, '{1}', '{2}')", watch.UserID, (uint)watch.Title.Namespace, DataCommand.MakeSqlSafe(watch.Title.AsUnprefixedDbPath()))).Execute(); }