UrlList ISession.Read() { List<ulong> ids = m_dataSource.ReadAll(); UrlList result = new UrlList(); foreach (ulong id in ids) { string caption = ""; string description = ""; DateTime timestamp = new DateTime(); string url = ""; if (m_dataSource.Read(id, out caption, out description, out timestamp, out url)) { UrlEntry entry = new UrlEntry(); entry.Caption = caption; entry.Description = description; entry.Timestamp = timestamp; entry.Url = url; result.entries.Add(entry); } } return result; }
UrlEntry ISession.Create() { UrlEntry ret = new UrlEntry(); ret.Id = m_dataSource.Create(); return ret; }
void ISession.Update(UrlEntry entry) { m_dataSource.Update(entry.Id, entry.Caption, entry.Description, entry.Timestamp, entry.Url); }
void ISession.Delete(UrlEntry entry) { m_dataSource.Delete(entry.Id); }