In Scala, you can use pattern matching to produce a result depending on the type of the input. For instance:
val title = content match { case blogPost: BlogP
Using Functional C# (from @Alireza)
var title = content.Match() .With(blogPost => blogPost.Blog.Title + ": " + blogPost.Title) .With(blog => blog.Title) .Result();