private static void SetPublishedDate(BlogPosts entity)
 {
     if (!entity.IsDraft && !entity.PublishedDateTime.HasValue)
     {
         entity.PublishedDateTime = DateTime.UtcNow;
     }
 }
partial         void BlogPostsSet_Updating(BlogPosts entity)
        {
            SetPublishedDate(entity);
        }