Try our conversational search powered by Generative AI!

Chris Banner
Jul 10, 2017
  3697
(1 votes)

What's new in Episerver Social 1.5?

This week brings the release of Episerver Social 1.5. In addition to a handful of internal enhancements and performance tweaks, this version introduces the AnyExpression. 

This new expression allows you to compare a field of your extension data against a set of values, matching documents where the field's value is represented by any within the set.

Consider a scenario where a collection of Comments has been extended with the following sample of extension data:

{ LuckyNumber = 7 }
{ LuckyNumber = 42 }
{ LuckyNumber = 5 }
{ LuckyNumber = 10 }

With the AnyExpression we can now identify those Comments with a LuckyNumber that matches any of a series of values.

var luckyNumberField = FilterExpressionBuilder<MyCommentExtension>.Field(ext => ext.LuckyNumber);
var luckiestComments = luckyNumberField.Any(new long[] { 5, 7, 9 });

var criteria = new CompositeCriteria<Comment, MyCommentExtension>
{                
    ExtensionFilter = luckiestComments 
};

var commentService = ServiceLocator.Current.GetInstance<ICommentService>();
var results = await commentService.GetAsync(criteria);

In the snippet show above, the service will return a set of Comments extended with the lucky numbers 5, 7, or 9. Given our initial sample, this means that we'd receive those comments with: 

{ LuckyNumber = 7 }
{ LuckyNumber = 5 }

This expression can be applied to any Episerver Social feature accepting extension data. For more details, feel free to dig into the developer guide.

Jul 10, 2017

Comments

192.168.l.254 192.168.1.254
192.168.l.254 192.168.1.254 Sep 7, 2018 05:28 PM

192.168.l.254

Please login to comment.
Latest blogs
Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog

The A/A Test: What You Need to Know

Sure, we all know what an A/B test can do. But what is an A/A test? How is it different? With an A/B test, we know that we can take a webpage (our...

Lindsey Rogers | Apr 15, 2024

.Net Core Timezone ID's Windows vs Linux

Hey all, First post here and I would like to talk about Timezone ID's and How Windows and Linux systems use different IDs. We currently run a .NET...

sheider | Apr 15, 2024