I'm writing a fluent API (been upgrading EntitySpaces) and I want to have this syntax ...
EmployeeQuery q = new EmployeeQuery("q");
q.Select(q.Id > () => // Notice Func<> syntax here, this won't compile !!!!
{
return new EmployeeQuery("e", out var q1)
.Where(q1.Id.IsNotNull()).All();
})
);
But you guess it, compile error. I overload all of the operators in my syntax and everything works but I cannot get this syntax to work, I think the ">" followed by the "() =>" syntax just confuses the compiler entirely and it could never actually work?
Note that above "q.Id" in the Select() methods returns an esQueryItem, thus the overload below ...
Here is my overload ...
public class esQueryItem
{
public static esComparison operator >(esQueryItem item, Func<esDynamicQuery> func)
{
return null;
}
public static esComparison operator <(esQueryItem item, Func<esDynamicQuery> func)
{
return null;
}
}