EBNF - free interface

Recently, I had to write a free interface for C # that would essentially mirror SQL. Yes, I know LINQ to SQL, but I'm wondering how “closer to metal” is to have something that essentially provides nothing more than the Intellisensified SQL shim inside C #.

eg.

var fq = new FluentQuery();
Expression<Action> =
    () => fq.SELECT.DISTINCT(Foo.ID).FROM(Foo).WHERE(Foo.Age > 22);

Now I thought that this concept could be generalized - that is, how about a common EBNF for a free generator interface? Does anyone know if such a beast exists?

+3
source share
1 answer

I like it, but you have to be sure to return types like HasFromAndSelect or something like that, so you won’t get fq.SELECT(Foo.ID).SELECT(Foo.Age).WHERE(Foo.Age > 22)or fq.WHERE(Foo.Age > 22).SELECT(Foo.ID)etc.

, , , CAPS LOCK MODE :)

+3

Source: https://habr.com/ru/post/1698850/


All Articles