示例#1
0
 public PostModel(Post post)
 {
     this.Id = post.Id;
     this.PostDate = post.PostDate;
     this.Title = post.Title;
     this.Text = post.Text;
 }
示例#2
0
        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;
        }