コード例 #1
0
 private SelectListItem ReadSelectListItem(SQLiteDataReader reader)
 {
     return new SelectListItem
     {
         Value = reader.Fetch<long>("ID").ToString(),
         Text = reader.Fetch<string>("Name")
     };
 }
コード例 #2
0
 private Category ReadCategory(SQLiteDataReader reader)
 {
     return new Category
     {
         ID = reader.Fetch<long>("ID"),
         Name = reader.Fetch<string>("Name"),
         CreatedOn = reader.Fetch<DateTime>("CreatedOn")
     };
 }
コード例 #3
0
 private User ReadUser(SQLiteDataReader reader)
 {
     User user = new User
     {
         Name = reader.Fetch<string>("Name"),
         CreatedOn = reader.Fetch<DateTime>("CreatedOn")
     };
     
     return user;
 }
コード例 #4
0
 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")
     };
 }
コード例 #5
0
        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;
        }
コード例 #6
0
 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")
     };
 }