5 ms·
Without type safety, there doesn't seem to be much to gain from this besides for a bit of syntax checking?
by kristiandupont 8y ago
Without type safety, there doesn't seem to be much to gain from this besides for a bit of syntax checking?
- scarface74 8y agoIn this case of LINQ, I can call methods like: var retiredMales = custRepo.Find(c => c.Age > 65 and c.Sex == “M”) and then have an interface with a member: List<Customer> Find(Expression<Func<Customer,bool>> expression): You can implement three classes for that interface - one that uses EF, one that uses Mongo, and one that just uses in an memory List for unit testing and they all translate the expression to the underlying data store. Theoretically, you could have an “expression” type in JS that can be parsed by the provider.
- jauco 8y agoWhat you’re looking for is the backtick in lisp. Or more generally: lisp macro’s where a function can inspect the ast of an argument and base it’s result on that. For those who gave never used linq: this allows the above function to translate the function to a sql, sparql or mongo query depending on the currently selected backend