private SelectListItem ReadSelectListItem(SQLiteDataReader reader) { return new SelectListItem { Value = reader.Fetch<long>("ID").ToString(), Text = reader.Fetch<string>("Name") }; }
private Category ReadCategory(SQLiteDataReader reader) { return new Category { ID = reader.Fetch<long>("ID"), Name = reader.Fetch<string>("Name"), CreatedOn = reader.Fetch<DateTime>("CreatedOn") }; }
private User ReadUser(SQLiteDataReader reader) { User user = new User { Name = reader.Fetch<string>("Name"), CreatedOn = reader.Fetch<DateTime>("CreatedOn") }; return user; }
private Comment ReadComment(SQLiteDataReader reader) { return new Comment { Body = reader.Fetch<string>("Body"), CreatedBy = reader.Fetch<long>("CreatedBy"), CreatedOn = reader.Fetch<DateTime>("CreatedOn"), ID = reader.Fetch<long>("ID"), ModifiedBy = reader.Fetch<long>("ModifiedBy"), ModifiedOn = reader.Fetch<DateTime>("ModifiedOn"), Title = reader.Fetch<string>("Title") }; }
private PostSummary ReadPostSummary(SQLiteDataReader reader) { PostSummary postSummary = new PostSummary { CategoryName = reader.Fetch<string>("CategoryName"), DateDetails = reader.Fetch<DateTime>("CreatedOn").ToDisplayDate(), PostID = reader.Fetch<long>("PostID"), Subject = reader.Fetch<string>("Subject"), Summary = reader.Fetch<string>("Summary"), UserID = reader.Fetch<long>("UserID"), UserName = reader.Fetch<string>("UserName") }; if (postSummary.Summary.Length == Constants.PostSummaryLength - 1) { postSummary.Summary += "…"; } return postSummary; }
private Post ReadPost(SQLiteDataReader reader) { return new Post { Body = reader.Fetch<string>("Body"), CategoryID = reader.Fetch<long>("CategoryID"), CreatedBy = reader.Fetch<long>("CreatedBy"), CreatedOn = reader.Fetch<DateTime>("CreatedOn"), ID = reader.Fetch<long>("ID"), ModifiedBy = reader.Fetch<long>("ModifiedBy"), ModifiedOn = reader.Fetch<DateTime>("ModifiedOn"), Subject = reader.Fetch<string>("Subject") }; }