How to use linqts - 10 common examples

To help you get started, we’ve selected a few linqts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rotemgrim / rooster-x / src / renderer / web-components / RoosterX.ts View on Github external
private sortMedia(list: IMetaDataExtended[]): IMetaDataExtended[] {
        const linqList = new List([...list]);
        console.log("orderBy", this._orderConfig);
        // static order for torrents
        if (this._showTorrents) {
            linqList.OrderByDescending((x: IMetaDataExtended): any => x.id);
        } else if (this._orderConfig.directionDescending) {
            linqList.OrderByDescending((x: IMetaDataExtended): any => x[this._orderConfig.orderBy]);
        } else {
            linqList.OrderBy((x: IMetaDataExtended): any => x[this._orderConfig.orderBy]);
        }

        let mediaArray = linqList.ToArray();
        if (this._orderConfig.showUnwatchedFirst) {
            mediaArray = _.orderBy(mediaArray, ["isWatched"], ["desc"]);
        }

        return mediaArray;
github dotnetcore / OSharp / samples / web / ui-clients / ng-alain8 / src / app / shared / components / ad-search / ad-search.component.ts View on Github external
ngOnInit() {
    this.columns = new List(this.columns)
      .Where(m => m.index && m.filterable && m.type !== 'date') // TODO: date 的UI未调好,暂不过滤
      .ToArray();
  }
github dotnetcore / OSharp / tests / web / ui / ng-alain / src / app / routes / admin / identity / user / user.component.ts View on Github external
onModuleWinSubmit() {
    let moduleRoot = this.moduleTree.dataSource.data()[0];
    let modules = [];
    this.osharp.getTreeNodes(moduleRoot, modules);
    let checkModuleIds = new List(modules).Where(m => m.checked).Select(m => m.Id).ToArray();
    let params = { userId: this.winUser.Id, moduleIds: checkModuleIds };

    this.http.post("api/admin/user/setmodules", params).subscribe(res => {
      this.osharp.ajaxResult(res, () => {
        this.grid.dataSource.read();
        this.moduleWindow.close();
      });
    });
  }
github dotnetcore / OSharp / tests / web / ui / ng-alain / src / app / routes / admin / identity / user / user.component.ts View on Github external
onRoleWinSubmit() {
    let roles = this.roleTree.dataSource.data();
    let checkRoleIds = new List(roles.slice(0)).Where(m => m.checked).Select(m => m.Id).ToArray();

    let params = { userId: this.winUser.Id, roleIds: checkRoleIds };

    this.http.post("api/admin/user/setroles", params).subscribe(res => {
      this.osharp.ajaxResult(res, () => {
        this.grid.dataSource.read();
        this.roleWindow.close();
      });
    });
  }
github dotnetcore / OSharp / tests / web / ui / ng-alain / src / app / routes / admin / identity / role / role.component.ts View on Github external
onWinSubmit() {
    let moduleRoot = this.moduleTree.dataSource.data()[0];
    let modules = [];
    this.osharp.getTreeNodes(moduleRoot, modules);
    let checkModuleIds = new List(modules).Where(m => m.checked).Select(m => m.Id).ToArray();
    let body = { roleId: this.winRole.Id, moduleIds: checkModuleIds };
    this.http.post("api/admin/role/SetModules", body).subscribe(res => {
      this.osharp.ajaxResult(res, () => {
        this.grid.dataSource.read();
        this.window.close();
      });
    });
  }
github dotnetcore / OSharp / tests / web / ui / ng-alain / src / app / routes / admin / security / module / module.component.ts View on Github external
onWindowSubmit(win) {
    let root = this.functionTree.dataSource.data()[0];
    let functions = [];
    this.osharp.getTreeNodes(root, functions);
    let checkFuncIds = new List(functions).Where(m => m.checked).Select(m => m.Id).ToArray();
    let body = { moduleId: this.winModule.Id, functionIds: checkFuncIds };
    this.http.post("api/admin/module/setfunctions", body).subscribe(res => {
      this.osharp.ajaxResult(res, () => {
        $("#btn-refresh-function").click();
        this.window.close();
      });
    });
  }
  //#endregion
github dotnetcore / OSharp / tests / web / ui / ng-alain / src / app / routes / admin / identity / user / user.component.ts View on Github external
onWinSubmit(win) {
    let roles = this.roleTree.dataSource.data();
    let checkRoleIds = new List(roles.slice(0)).Where(m => m.checked).Select(m => m.Id).ToArray();

    let moduleRoot = this.moduleTree.dataSource.data()[0];
    let modules = [];
    this.osharp.getTreeNodes(moduleRoot, modules);
    let checkModuleIds = new List(modules).Where(m => m.checked).Select(m => m.Id).ToArray();
    let params = { userId: this.winUser.Id, roleIds: checkRoleIds, moduleIds: checkModuleIds };

    this.http.post("/api/admin/user/setpermission", params).subscribe(res => {
      this.osharp.ajaxResult(res, () => {
        this.grid.dataSource.read();
        this.window.close();
      });
    });
  }
github dotnetcore / OSharp / tests / web / OSharp.Demo.Web / ClientApp / app / shared / angle / core / menu / menu.service.ts View on Github external
removeMenu(item: menuItem) {
        let list = new List<menuitem>(this.menuItems);
        this.menuItems = list.RemoveAll(m =&gt; m.text == item.text).ToArray();
    }
</menuitem>
github dotnetcore / OSharp / tests / web / ui / ng-alain / src / app / routes / admin / security / shared / filter-group / filter-rule.component.ts View on Github external
}
        break;
      case 'System.String':
        this.operateEntries = this.getOperateEntries([FilterOperate.Equal, FilterOperate.NotEqual, FilterOperate.StartsWith, FilterOperate.EndsWith, FilterOperate.Contains, FilterOperate.NotContains]);
        if (!this.rule.Value) {
          this.rule.Value = '';
        }
        break;
      default:
        this.operateEntries = this.getOperateEntries([FilterOperate.Equal, FilterOperate.NotEqual, FilterOperate.Less, FilterOperate.LessOrEqual, FilterOperate.Greater, FilterOperate.GreaterOrEqual, FilterOperate.StartsWith, FilterOperate.EndsWith, FilterOperate.Contains, FilterOperate.NotContains]);
        if (!this.rule.Value) {
          this.rule.Value = '';
        }
        break;
    }
    if (!this.rule.Operate || !new List(this.operateEntries).Any(m => m.Operate == this.rule.Operate)) {
      this.rule.Operate = this.operateEntries[0].Operate;
    }
  }
github tahaipek / slack-channel-cleaner / index.ts View on Github external
request({ url: slack.url + slack.api.channels_history, qs: { token: slack.token, channel: e, count: 1000 }, timeout: 5000, json: true }, (err, resp, reqData) =&gt; {

        if (err || resp.statusCode != 200)
            return err || new Error("Error: " + resp.statusCode);

        if (reqData.ok || reqData.ok == "true") {

            var messages = reqData.messages;
            var messageList = new List(messages);

            console.log(colors.debug(" &gt;&gt; Fetching the channel history. ID: " + e + " / Count: " + messageList.Count() + " " + (messageList.Count() == 0 ? "- " + colors.error("Data not available") : "")));

            messageList.ToArray().forEach(k =&gt; {
                _messageList.push({ channelId: e, message: k });
            });

            if (messageList.Count() &gt; 0 &amp;&amp; !start)
                removeHistoryMessage(0);

            var i = index + 1;
            getHistoryMessage(data, i);

        } else {
            console.log(colors.error("Error: " + reqData.error));
        }

linqts

LinQ + TypeScript

MIT
Latest version published 3 months ago

Package Health Score

72 / 100
Full package analysis

Popular linqts functions