Releases: dibiancoj/Linq4Javascript
Order By Case Sensitive
Typescript 2.1.4 Release And ReadonlyArray
This release was made to handle Typescript 2.1.4 and readonly arrays. Added an interface so you can use Linq4Javascript off of this array type in Typescript.
var _array: ReadonlyArray<number> = Object.freeze([1,2,3,4]);
var results = _array.Where(x => x == 2).ToArray();
Added GroupJoin and DefaultIfEmpty methods
Added the following methods
- GroupJoin
- DefaultIfEmpty
Please see the documentation or unit tests for more detail on how to use the new methods.
I will try to batch the releases better going forward.
Added Join Method. Removed ConcatQuery and UnionQuery
IMPORTANT: Removed ConcatQuery and UnionQuery. Please just use Concat and Union for all scenarios (either an array or query to be concat or union). Sorry for the inconvenience.
Added the join method
Join(OuterArray Or Query, function(I): InnerTablePropertySelector, function(O): OuterTablePropertySelector, function(I,O): Creates the join record where I is the inner table and O is the outer table. Description: Will join 2 datasets by a key and will create a new row based on the 2 records that match. Similar to a Sql inner join Example:
var mySkipWhileResult= _Array.Join(_OuterArray, x => x.Id, y => y.Id, (x,y) => { Id: x.Id, StateName: y.Description);
Note: Not supported in async mode yet.
** No fixes were made in this release. If you don't need the join method then you don't need to upgrade.
ElementAt And ElementAtDefault
Added 2 methods.
- ElementAt(Index): T was added to the API. Pass in the index number and the element sitting at that position will be returned. If the index is greater then the array or query count an error will be returned.
- ElementAtDefault(Index): T was also added to the API. Pass in the index number and the element sitting at that position will be returned. If the index is greater then the array or query count null will be returned.
Typescript 1.8 Breaking Change
It appears Microsoft had a breaking change with Typescript 1.8. microsoft/TypeScript#3876
This caused Linq4Javascript to throw errors when trying to compile in Typescript.
Async
Add the ability to run a query without locking the UI on long running queries.
Async is used to offload any query off of the UI thread to prevent freezing and slowness on the site. The implementation uses Html 5 Web Workers. If a user is using an older browser, JLinq will fallback to the normal ToArray() method to complete the query results.
Please see the wiki page for full documentation on the syntax.
Move To Git Hub
Moved From Code Plex To Git Hub: (https://linq4javascript.codeplex.com/)
-Removed 2 deprecated method. LastItem() & AnyItems. Use Last() / Any() for the equivalent methods.
-Added AsQueryable() as an extension method off of an Array. Makes it easier to do the following:
ie: var query = List.AsQueryable();
if (filter1 != null)
{
query = query.Where(function(x .....))
}
if (filter2 != null)
{
query = query.Where(function(x......))
}
//grab the results
var results = query.ToArray();