Questions tagged [linq.js]

An implementation of List and Sequence operations for JavaScript, as inspired by .NET's Language INtegrated Query (LINQ).

LINQ.js

This project is an implementation of List and Sequence operations for JavaScript, as inspired by .NET's Language INtegrated Query (LINQ).

Features

  • All .NET 4.0 methods and many extras (with inspiration from Rx, Achiral, Haskell, Ruby, etc...)
  • Complete lazy evaluation
  • Full IntelliSense support for VisualStudio
  • Two versions - linq.js and jquery.linq.js (jQuery plugin)
  • Support Windows Script Host
  • Binding for Reactive Extensions for JavaScript(RxJS) and IntelliSense Generator -> see documentation
  • NuGet packages: linq.js, linq.js-jQuery, linq.js-Bindings

See or MSDN for more information regarding LINQ itself.

LINQ.js official website: http://linqjs.codeplex.com/

108 questions
1
vote
2 answers

nested for loop in javascript knockout

I have two observable arrays: var viewModel = { PositionTypes: ko.observableArray([]), Users: ko.observableArray([]) } POSITION ViewModel var positionViewModel = function (data) { var _self = this; _self.PositionName =…
Masriyah
  • 2,445
  • 11
  • 49
  • 91
1
vote
2 answers

where function of Linq.js on Json data not working

How to correct following code for desired output, var Data = [{ "A": -27, "B": -39 }, { "A": 28, "B": 0}] var filter = "x[A]==28"; var findItem = Enumerable.From(Data) .Where(function (x) { return filter ; }) …
irfan Munir
  • 151
  • 3
  • 17
1
vote
1 answer

linq.js: GroupBy(), then ToJSON()

I'm new to linq.js. I'd like to do a GroupBy(), which is then converted to JSON. However, I'm getting back a string array. var data = [ { "Gender":"M" }, { "Gender":"M" }, { "Gender":"F" } ]; var grouped_dt =…
matt
  • 2,857
  • 7
  • 33
  • 58
0
votes
0 answers

Invalid or unexpected token at new Function of Enumerable using linqjs

I want to return an object using Enumerable of linqjs. But this code gives an error "Invalid or unexpected token". When I check the same condition using if condition in forEach then it is working perfectly. But what's problem with Enumerable? Using…
0
votes
1 answer

Linq js group by Sum appending string instead of adding

I am using linq.js "//cdnjs.cloudflare.com/ajax/libs/linq.js/2.2.0.2/linq.min.js" The objective is to get "sum" of a field using group by clause. The code is working fine but "quantity" is considered as a string and appending numbers. If I use…
san
  • 304
  • 4
  • 20
0
votes
1 answer

How can replace all case in value of column using linq.js?

I using linq.js and i want replace single quotes when searching data. This my code. var list = [ { a: "50", b: 4, c: 1 }, { a: "60", b: 3, c: 7 }, { a: "'540'", b: 3, c: 3 } ]; var val = "'540'"; val =…
D T
  • 3,522
  • 7
  • 45
  • 89
0
votes
1 answer

How search text contain single quotes with linq.js?

I using linq.js at: https://cdnjs.cloudflare.com/ajax/libs/linq.js/2.2.0.2/linq.js This is sample data to test: var list = [{ a: "50", b: 4, c: 1 }, { a: "60", b: 3, c: 7 }, { a: "50'60", b: 3, c: 3 }]; var…
D T
  • 3,522
  • 7
  • 45
  • 89
0
votes
4 answers

Convert array of employees to Dictionary

So I'm using the LinqJS library to currently achieve the following: var allEmployees = [ { "Id": 1374, "FirstName": "John", "LastName": "Doe" }, { "Id": 1375, …
ThePerplexedOne
  • 2,920
  • 15
  • 30
0
votes
1 answer

linq.js join with two json

I have two json data var orders = [ {seller: "Test1", sell_count: 5, sell_amount: 1500}, {seller: "Test2", sell_count: 2, sell_amount: 7500} ]; var views = [ {seller: "Test1", pc_view: 123, mobile_view: 87}, {seller: "Test2", pc_view:56,…
Cris Kwon
  • 25
  • 5
0
votes
2 answers

generate html table dynamically from json data

I need to generate html table dynamically and list driver_id underneath. It is something similar to pivot but the problem is zone_name can change every day. I'm using jquery and linq.js. so far what I have tried: var data = [ …
dawncode
  • 578
  • 1
  • 8
  • 22
0
votes
1 answer

Array filter linq does not return expected result

I'm trying to get existCount from an array, which has id in selected array. But something went wrong, I had an item with id = 5493 but existCount.length = 0 My JS code: Chrome Console view: Where my fault? How can I fix it? Thanks!
user9506034
0
votes
2 answers

linq for js: how to get cartesian product of multiple arrays

I have an unpredictable number of arrays as showed on the picture below. Using linq for js I would like to get a Cartesian product of these arrays ie. { {AttributeTypeId: 10, AttributeId: 34, AttributeName: "b11 13-128"} {AttributeTypeId:…
Pablo Gablo
  • 55
  • 1
  • 2
  • 7
0
votes
0 answers

How to install linq.js in Asp.net Core Web Application (.net framework) and how to use it?

We are developing an Asp.net Core Web Application (.net framework). I want to use linq.js in this new project. Bower is giving many same name options but does not seems to be the desired version, as description and version is different from the the…
Anil
  • 3,722
  • 2
  • 24
  • 49
0
votes
1 answer

Linq.js Sum inside Where

Is there any way to filter in Linq.JS with SUM ? My try: var query = Enumerable .From(self.data()) .Where("$$.Sum($.percent) > 100") .ToArray(); Error: linq.js: Uncaught TypeError: $$.Sum is not a function
0
votes
1 answer

Linq to linq.js translation with value assignation

I am trying to assign a value with a linq.js expresion. The linq lamba expresion would be like this: List roomsAvailable = Spaces.Select(s => { s.Available = s.Rooms.Where(r => r.RoomTypeRanges.Any(t => t.Type.ToString()…
Lucio
  • 1
  • 2