public void Save(CrossRef_AniDB_TvDB obj) { using (var session = JMMService.SessionFactory.OpenSession()) { // populate the database using (var transaction = session.BeginTransaction()) { session.SaveOrUpdate(obj); transaction.Commit(); } } }
// default constructor public AddCrossRef_AniDB_TvDBRequest(CrossRef_AniDB_TvDB data, string seriesName) { this.AnimeID = data.AnimeID; this.TvDBID = data.TvDBID; this.TvDBSeason = data.TvDBSeasonNumber; string username = ServerSettings.AniDB_Username; if (ServerSettings.WebCache_Anonymous) username = Constants.AnonWebCacheUsername; this.Username = username; this.SeriesName = seriesName; }