Skip to content

Instantly share code, notes, and snippets.

@geykel
Last active January 12, 2018 16:52
Embed
What would you like to do?
// 1
using Sitecore.Framework.Rules;
namespace MiTienda.Commerce.Plugin.Custom.Conditions
{
// 2
[EntityIdentifier("¿El número [especificado] es impar?")]
// 3
public class NumeroEsImparCondition : ICondition
{
// 4
public IRuleValue<int> Numero { get; set; }
// 5
public bool Evaluate(IRuleExecutionContext context)
{
// 6
return Numero.Yield(context) % 2 != 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment