示例#1
0
        /// <summary>
        /// Converts this model to the backend model.
        /// </summary>
        /// <returns>A sulucz post.</returns>
        public SuluczPost ToSuluczPost()
        {
            var sulContents = new SuluczPostContent[this.RawContent.Length];

            for (var i = 0; i < sulContents.Length; i++)
            {
                sulContents[i] = new SuluczPostContent(
                    this.MetaData.Id ?? 0,
                    i,
                    this.RawContent[i].Content,
                    this.RawContent[i].ContentType.ParseEnum <SuluczContentType>(),
                    0,
                    0);
            }

            return(new SuluczPost(this.MetaData.ToSuluczMetaData(), sulContents, this.Tags));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PostContent"/> class.
 /// </summary>
 /// <param name="content">The content.</param>
 public PostContent(SuluczPostContent content)
 {
     this.Content     = content.Content;
     this.ContentType = content.ContentType.ToString();
 }