UniverseQuery 2.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package UniverseQuery --version 2.0.1
                    
NuGet\Install-Package UniverseQuery -Version 2.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UniverseQuery" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UniverseQuery" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="UniverseQuery" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add UniverseQuery --version 2.0.1
                    
#r "nuget: UniverseQuery, 2.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package UniverseQuery@2.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=UniverseQuery&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=UniverseQuery&version=2.0.1
                    
Install as a Cake Tool

Universe

A simpler way of querying a CosmosDb Namespace

How-to:

  1. Your models / cosmos entities should inherit from the interface
public class MyCosmosEntity : ICosmicEntity
{
  public string FirstName { get; set; }
  
  public string LastName { get; set; }
  
  // The properties below are implementations from ICosmicEntity
  public string id { get; set; }
  public DateTime AddedOn { get; set; }
  public DateTime ModifiedOn { get; set; }

  [JsonIgnore]
  public string PartitionKey => FirstName;
}
  1. Create a repository like so:
public class MyRepository : Galaxy<MyModel>
{
    public MyRepository(CosmosClient client, string database, string container, string partitionKey) : base(client, database, container, partitionKey)
    {
    }
}

// If you want to see debug information such as the full Query text executed, use the format below:
public class MyRepository : Galaxy<MyModel>
{
    public MyRepository(CosmosClient client, string database, string container, string partitionKey) : base(client, database, container, partitionKey, true)
    {
    }
}
  1. In your Startup.cs / Main method / Program.cs, configure the CosmosClient like so:
_ = services.AddScoped(_ => new CosmosClient(
    System.Environment.GetEnvironmentVariable("CosmosDbUri"),
    System.Environment.GetEnvironmentVariable("CosmosDbPrimaryKey"),
    clientOptions: new()
    {
        Serializer = new UniverseSerializer() // This is from Universe.Options
        AllowBulkExecution = true // This will tell the underlying code to allow async bulk operations
    }
));
  1. In your Startup.cs / Main method / Program.cs, configure your CosmosDb repository like so:
_ = services.AddScoped<IGalaxy<MyModel>, MyRepository>(service => new(
    client: service.GetRequiredService<CosmosClient>(),
    database: "database-name",
    container: "container-name",
    partitionKey: "/partitionKey"
));
  1. Inject your IGalaxy<MyModel> dependency into your classes and enjoy a simpler way to query CosmosDb
Example Query:
MyModel myModel = await IGalaxy<MyModel>.Get(new Catalyst("LastName", "last name value"));
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.0-preview.5 76 9/12/2025
3.1.0-preview.4 528 8/28/2025
3.1.0-preview.3 159 8/28/2025
3.1.0-preview.2 161 8/28/2025
3.1.0-preview.1 148 8/25/2025
3.0.6-preview.2 951 8/18/2025
3.0.5 468 8/5/2025
3.0.4 157 7/15/2025
3.0.3 105 6/27/2025
3.0.2 85 5/31/2025
2.1.0 493 3/25/2025
2.0.1 223 9/24/2023
2.0.0 331 3/31/2023
1.4.1 662 1/20/2023
1.4.0 942 10/20/2022
1.3.2 672 10/11/2022
1.2.1 888 8/22/2022
1.2.0 517 8/12/2022
1.1.4 562 8/5/2022