Put interface behind database provider for testing. Use state object to get data from database, then map to model.
This commit is contained in:
parent
5a0d0933ce
commit
20ccdd07f1
11 changed files with 118 additions and 34 deletions
|
@ -1,9 +1,27 @@
|
|||
using System;
|
||||
using Website.Data.States;
|
||||
|
||||
namespace Website.Models
|
||||
{
|
||||
public class BlogPost
|
||||
{
|
||||
public int PostId { get; set; }
|
||||
public string PostTitle { get; set; }
|
||||
public string Post_Title { get; set; }
|
||||
public BlogPost(BlogPostState state)
|
||||
{
|
||||
Id = state.Post_Id;
|
||||
Title = state.Post_Title;
|
||||
Content = state.Post_Content;
|
||||
Timestamp = state.Post_Timestamp;
|
||||
Draft = state.Post_Draft;
|
||||
Url = state.Post_Url;
|
||||
UserId = state.User_Id;
|
||||
}
|
||||
|
||||
public int Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Content { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
public string Draft { get; set; }
|
||||
public string Url { get; set; }
|
||||
public int UserId { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue