private async Task PrepareBlogPostModel(BlogPostModel model, BlogPost blogPost) { if (blogPost == null) { throw new ArgumentNullException(nameof(blogPost)); } if (model == null) { throw new ArgumentNullException(nameof(model)); } model.Id = blogPost.Id; model.MetaTitle = blogPost.GetTranslation(x => x.MetaTitle, _workContext.WorkingLanguage.Id); model.MetaDescription = blogPost.GetTranslation(x => x.MetaDescription, _workContext.WorkingLanguage.Id); model.MetaKeywords = blogPost.GetTranslation(x => x.MetaKeywords, _workContext.WorkingLanguage.Id); model.SeName = blogPost.GetSeName(_workContext.WorkingLanguage.Id); model.Title = blogPost.GetTranslation(x => x.Title, _workContext.WorkingLanguage.Id); model.Body = blogPost.GetTranslation(x => x.Body, _workContext.WorkingLanguage.Id); model.BodyOverview = blogPost.GetTranslation(x => x.BodyOverview, _workContext.WorkingLanguage.Id); model.AllowComments = blogPost.AllowComments; model.CreatedOn = _dateTimeService.ConvertToUserTime(blogPost.StartDateUtc ?? blogPost.CreatedOnUtc, DateTimeKind.Utc); model.Tags = blogPost.ParseTags().ToList(); model.NumberOfComments = blogPost.CommentCount; model.UserFields = blogPost.UserFields; //prepare picture model await PrepareBlogPostPictureModel(model, blogPost); }