npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tsonic/efcore

v10.0.37

Published

TypeScript type definitions for Microsoft.EntityFrameworkCore.* for .NET 10

Readme

@tsonic/efcore

TypeScript type definitions for Entity Framework Core 10 (Microsoft.EntityFrameworkCore.*) for use with the Tsonic compiler (TypeScript → .NET).

This package is generated by tsbindgen from the official NuGet assemblies and is intended to give you an editor-friendly, strongly typed surface while compiling to real EF Core APIs.

What this package is (and isn’t)

  • It is a TypeScript type package (.d.ts) + ESM stubs for the EF Core assemblies.
  • It is not a JavaScript runtime implementation of EF Core (the .js files are module stubs for type-only use).
  • You still need the actual .NET assemblies via NuGet in your Tsonic workspace (see below).

Install (types)

npm install @tsonic/efcore @tsonic/dotnet @tsonic/core

Use with Tsonic (recommended)

If you want a deterministic “one command” setup for both the .NET assemblies and the TypeScript bindings, use tsonic add nuget and pass this package as the types argument:

tsonic add nuget Microsoft.EntityFrameworkCore <version> @tsonic/efcore

If you omit the @tsonic/efcore argument, Tsonic will generate bindings locally instead.

Providers

Pick the provider that matches your database:

  • SQLite: @tsonic/efcore-sqlite
  • SQL Server: @tsonic/efcore-sqlserver
  • PostgreSQL (Npgsql): @tsonic/efcore-npgsql

Example:

tsonic add nuget Microsoft.EntityFrameworkCore.Sqlite <version> @tsonic/efcore-sqlite

Imports

The package is shipped as ESM. Import EF Core namespaces via explicit module paths:

import { DbContext, DbContextOptions, DbSet } from "@tsonic/efcore/Microsoft.EntityFrameworkCore.js";

Provider-specific APIs come from the provider package:

import { SqliteDbContextOptionsBuilderExtensions } from "@tsonic/efcore-sqlite/Microsoft.EntityFrameworkCore.js";

LINQ + EF extension methods (idiomatic queries)

EF Core relies heavily on extension methods (LINQ operators like Where/Select and EF async operators like CountAsync/ToArrayAsync).

In Tsonic, you opt into a “C# using semantics” extension surface by wrapping the receiver with asinterface<...> and the generated ExtensionMethods helpers:

import { asinterface } from "@tsonic/core/lang.js";
import type { ExtensionMethods as Linq } from "@tsonic/dotnet/System.Linq.js";
import type { ExtensionMethods as Ef } from "@tsonic/efcore/Microsoft.EntityFrameworkCore.js";
import type { DbSet } from "@tsonic/efcore/Microsoft.EntityFrameworkCore.js";

type DbSetQuery<T> = Ef<Linq<DbSet<T>>>;

// Example: turn a DbSet<T> into something that has LINQ + EF async operators.
const q = asinterface<DbSetQuery<PostEntity>>(db.posts);

const pageviews = await q.Where((p) => p.Published === true).CountAsync();
const rows = await q.Where((p) => p.Published === true).ToArrayAsync();

You can always call extension methods via their static classes as well, but the pattern above gives you the most idiomatic “instance-style” call sites.

Example

Minimal DbContext + options:

import { DbContext, DbContextOptions, DbContextOptionsBuilder, DbSet } from "@tsonic/efcore/Microsoft.EntityFrameworkCore.js";
import { SqliteDbContextOptionsBuilderExtensions } from "@tsonic/efcore-sqlite/Microsoft.EntityFrameworkCore.js";

export class BlogDbContext extends DbContext {
  get posts(): DbSet<PostEntity> {
    return this.Set<PostEntity>();
  }

  constructor(options: DbContextOptions) {
    super(options);
  }
}

export const createDbOptions = (dbPath: string): DbContextOptions => {
  const optionsBuilder = new DbContextOptionsBuilder();
  SqliteDbContextOptionsBuilderExtensions.UseSqlite(optionsBuilder, `Data Source=${dbPath}`);
  return optionsBuilder.Options;
};

Versioning

This repo is versioned by .NET major:

Development (regenerating bindings)

This repo is generated from NuGet assemblies:

npm install
npm run generate:10

License

MIT