JustBlog.Core.BlogRepository.AddPost C# (CSharp) Method

AddPost() public method

Adds a new post and returns the id.
public AddPost ( JustBlog.Core.Objects.Post post ) : int
post JustBlog.Core.Objects.Post
return int
        public int AddPost(Post post)
        {
            using (var tran = _session.BeginTransaction())
              {
            _session.Save(post);
            tran.Commit();
            return post.Id;
              }
        }