dapper中使用类似whereif语句

WHERE (@CategoryId IS NULL OR CategoryId = @CategoryId)

类似于

WhereIf(!string.IsNullOrEmpty(a), A = a);
原文地址:https://www.cnblogs.com/lishidefengchen/p/15635733.html