partial void DeleteWikiContent(WikiContent instance);
partial void InsertWikiContent(WikiContent instance);
partial void UpdateWikiContent(WikiContent instance);
private void detach_WikiContents(WikiContent entity) { this.SendPropertyChanging(); entity.Wiki = null; }
private void attach_WikiContents(WikiContent entity) { this.SendPropertyChanging(); entity.Wiki = this; }
WikiContent CreateWikiContent(string username, string content, KEYID keyId, string reversion) { var wikiContent = new WikiContent() { WikiContentID = IDProvider.GetNewId("WikiContent"), KID = keyId.ToString(), Content = content, CrUserName = username, CreatedTime = TimeProvider.Now, Reversion = reversion }; return wikiContent; }
internal void WriteWiki(WikiName name, WikiContent content) { Wiki wiki = new Wiki(); wiki.Name = name; wiki.Content = content; WriteWiki(wiki); }
internal List<Wiki> GetWikisByName(WikiName name) { List<Wiki> list = new List<Wiki>(); var con = ContextFactory.GetNewContext(); list = (from wiki in con.Wikis where wiki.Name == name.Text select new Wiki() { Content = new WikiContent(wiki.Content), Name = new WikiName(wiki.Name), Version = new WikiVersion(wiki.Version), CreatedAt = wiki.CreatedAt }).ToList(); return list; using (SqlConnection connection = new SqlConnection()) { connection.ConnectionString = connectionString; SqlCommand cmd = connection.CreateCommand(); cmd.CommandText = "SELECT * FROM [Wiki] WHERE name='" + name.Text + "'"; logger.Info(cmd.CommandText); connection.Open(); SqlDataReader reader = cmd.ExecuteReader(); try { while (reader.Read()) { Wiki wiki = new Wiki(); WikiName n = new WikiName(reader.GetString(1)); WikiContent c = new WikiContent(reader.GetString(2)); WikiVersion v = new WikiVersion(reader.GetInt32(3)); wiki.Name = n; wiki.Content = c; wiki.Version = v; wiki.CreatedAt = reader.GetDateTime(4); list.Add(wiki); } } finally { if (!reader.IsClosed) { reader.Close(); } } } return list; }