public static AsyncOperand OrAsync(AsyncOperand a, AsyncOperand b) { return(new LazyOperand(async delegate { if (await a.ToBoolAsync().ConfigureAwait(false)) { return new BoolOperand(true); } return (await b.ToBoolAsync().ConfigureAwait(false)) ? new BoolOperand(true) : new BoolOperand(false); })); }
public static async Task <AsyncOperand> Not(AsyncOperand a) { return(new BoolOperand(!(await a.ToBoolAsync().ConfigureAwait(false)))); }
public static AsyncOperand AndAsync(AsyncOperand a, AsyncOperand b) { return(new LazyOperand(async() => (await a.ToBoolAsync().ConfigureAwait(false) && await b.ToBoolAsync().ConfigureAwait(false)) ? new BoolOperand(true) : new BoolOperand(false))); }