11 ms·
When I mean LINQ, i don't necessarily mean querying SQL. Working, filtering, grouping, selecting from collections in memory works very well. And i don't necessa
by jve 8y ago
When I mean LINQ, i don't necessarily mean querying SQL. Working, filtering, grouping, selecting from collections in memory works very well. And i don't necessariliy also mean LINQ query syntax, but it can also be method syntax: .Where().Select()...
And the power of ExpressionTrees that allows you to interpret code your own way. For example, substituting SharePoint CSOM library
.IsPropertyAvailable(string)
with
IsPropertyAvailable<T>(this T clientObject, Expression<Func<T, object>> propertySelector) [0]
is neat. Instead of magic strings you now have compile-time checking. Now you write
.IsPropertyAvailable(s => s.ServerRelativeUrl)
instead of
.IsPropertyAvailable("ServerRelativeUrl")
As for SQL, it may sometimes be a blocker, yes. But EF Core, for example, provides a FromSql method to use for complex queries.
[0]: https://github.com/SharePoint/PnP-Sites-Core/blob/206ee97d4b0a418614629c2ef39ebd23c3e75cb0/Core/OfficeDevPnP.Core/Extensions/ClientObjectExtensions.cs#L34 https://github.com/SharePoint/PnP-Sites-Core/blob/206ee97d4b...