tspence / csharp-searchlight

A lightweight, secure framework for a fluent REST API with robust, secure searching features.
Apache License 2.0
11 stars 7 forks source link

Improve error handling for LINQ executor type mismatches #106

Closed tspence closed 2 years ago

tspence commented 2 years ago

If you accidentally run the LINQ executor on a different type than Searchlight understands, there is a risk that your field types won't match exactly. The scenario in question is a potential risk when you have different data models for an entity (representing the database) and a model (representing the API).

This code adds assertions that verify whether the problem has occurred and throws appropriate Searchlight errors.