expressionvisitor

Case insensitive string compare in LINQ expression

吃可爱长大的小学妹 提交于 2019-11-30 04:59:32
问题 I'm trying to write an ExpressionVisitor to wrap around my LINQ-to-object expressions to automatically make their string comparisons case insensitive, just as they would be in LINQ-to-entities. EDIT: I DEFINITELY want to use an ExpressionVisitor rather than just applying some custom extension or something to my expression when it is created for one important reason: The expression being passed to my ExpressionVisitor is generated by the ASP.Net Web API ODATA layer, so I don't have control

ExpressionVisitor soft delete

一笑奈何 提交于 2019-11-28 11:46:50
We're having some issues implementing soft delete functionality with entity framework. The idea is to use a repository which is aware of the EF context. On the level of the repository we implemented a plugin system, these plugins get executed whenever an action is done on the repository. For example when we call Repository.GetQuery<Relation>() the plugins get executed. One of the plugins is a LogicalDeletePlugin , this plugin should add a Where(x => x.IsDeleted) statement to each table which is in the select. The idea was to implement this IsDeleted plugin using an ExpressionVisitor which

ExpressionVisitor soft delete

╄→гoц情女王★ 提交于 2019-11-27 06:26:47
问题 We're having some issues implementing soft delete functionality with entity framework. The idea is to use a repository which is aware of the EF context. On the level of the repository we implemented a plugin system, these plugins get executed whenever an action is done on the repository. For example when we call Repository.GetQuery<Relation>() the plugins get executed. One of the plugins is a LogicalDeletePlugin , this plugin should add a Where(x => x.IsDeleted) statement to each table which