InternetException

LINQ

LINQ · 3 posts (all tags)

Enhancing your .NET API with query language

· 1690 words · ~8 min read · updated · in .NET, ASP.NET, Hamster Wheel

#NuGet #LINQ #API design #HLinq

What is query language? SQL is Structured Query Language and you use it to query your database for data you are interested in. It does not have to do anything with your API. If you ever were working with big XML files you probably used XQuery or XPath, query languages designed to XML for data. There are specialized languages that are designed to work with APIs to query them for data. For example, you probably heard about GraphQL or even used it when you were working with some API.

Read the whole thing →

HLinq design

· 4639 words · ~23 min read · in .NET, ASP.NET, Hamster Wheel

#LINQ #delegates #reflection #Entity Framework

A bit of history

I remember the day when I started writing the HLinq query language. It was weekend and I was experimenting with writing Single endpoints for Hamster Wheel. Single endpoints were almost done and next step was to write List endpoint. This would allow to get list of records of specific type. After I got single GET returns correct data for chosen record id, list should not be hard to implement. Then just create, update and delete. Basic CRUD API in Hamster Wheel would be finished. I was thrilled that I actually was able to do such thing.

Read the whole thing →

Linq

· 98 words · ~1 min read · in .NET, interview

#LINQ

consistent model for working with data from various kinds of sources and formats (XML, SQL, ADO.NET, Datasets, .NET collections etc) 3 stages of working with LINQ: obtain data source create the query execute the query data sources implements IEnumerable<> and are called queryable types IQueryable<> interface inherits from IEnumerable<> generally it is better to use LINQ via IQueryable<> which produces deferred query instead of producing result immediately queries can be executed multiple times queries can be forced immediate execution via Count(), Max(), ToList() or ToArray() etc. LINQ to DB libraries (like EntityFramework) usually are implemented via Expression …

Read the whole thing →