public PostModel(Post post) { this.Id = post.Id; this.PostDate = post.PostDate; this.Title = post.Title; this.Text = post.Text; }
public BResult AddPost(string title, string text) { Post p = new Post() { PostDate = DateTime.Now, Title = title.Trim(), Text = text.Trim() }; _result.EntityId = _repository.Save(p); return _result; }