Skip to content

Instantly share code, notes, and snippets.

@geykel
Last active January 12, 2018 16:52
Show Gist options
  • Save geykel/202283f5c139fa49725395dc48e3fdbc to your computer and use it in GitHub Desktop.
Save geykel/202283f5c139fa49725395dc48e3fdbc to your computer and use it in GitHub Desktop.
// 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