Complete API surface for Weaviate.Client.Managed.
- WeaviateContext
- CollectionSet<T>
- ManagedCollection<T>
- CollectionMapperQueryClient<T>
- GenerativeQueryExecutor<T>
- WeaviateAdmin
- PendingInsert<T>
- PendingDelete<T>
- PendingUpdate<T>
- PendingReference<T>
- AggregateStarter<T>
- Extension Methods
- Models
EF Core-like base class for managing collections. Derive from this class and declare CollectionSet<T> properties.
public class BookstoreContext : WeaviateContext
{
public BookstoreContext(WeaviateClient client) : base(client) { }
public CollectionSet<Book> Books { get; set; } = null!;
public CollectionSet<Author> Authors { get; set; } = null!;
}| Property | Type | Description |
|---|---|---|
Client |
WeaviateClient |
The underlying Weaviate client |
Admin |
WeaviateAdmin |
Administrative operations (backup, RBAC, cluster, health) |
Tenant |
string? |
Current tenant scope (null if unscoped) |
ConsistencyLevel |
ConsistencyLevels? |
Current consistency level (null if default) |
Task<T> Insert<T>(T entity, CancellationToken ct = default) where T : class, new()Inserts a single entity and returns it with its [WeaviateUUID] property populated.
// Capture the returned entity to get its generated ID
var book = await context.Insert(new Book { Title = "Foundation" });
Console.WriteLine(book.Id); // Guid assigned by WeaviatePendingInsert<T> Insert<T>(params T[] entities) where T : class, new()Creates a pending batch insert. IDs are assigned back to [WeaviateUUID] properties in-place when executed. Directly awaitable or chainable. See PendingInsert<T>.
Task<T> Update<T>(T entity, CancellationToken ct = default) where T : class, new()Updates a single entity (PATCH semantics) and returns it. Uses the entity's [WeaviateUUID] property.
PendingUpdate<T> Update<T>(params T[] entities) where T : class, new()Updates multiple entities using their [WeaviateUUID] properties (PATCH semantics). Directly awaitable. See PendingUpdate<T>.
PendingDelete<T> Delete<T>(params Guid[] ids) where T : class, new()Deletes entities by ID. Directly awaitable or chainable. See PendingDelete<T>.
PendingDelete<T> Delete<T>(params T[] entities) where T : class, new()Deletes entities using their [WeaviateUUID] property. Directly awaitable or chainable.
Task DeleteMany<T>(IEnumerable<T> entities, CancellationToken ct = default) where T : class, new()Batch deletes entities using Filter.UUID.ContainsAny.
PendingReference<T> AddReference<T, TRef>(T entity,
Expression<Func<T, object?>> property, TRef target,
CancellationToken ct = default) where T : class, new()Adds a cross-reference link from entity to target. Directly awaitable or chainable. See PendingReference<T>.
await context.AddReference<Article, Category>(article, a => a.Category, techCategory);ContextAggregateBuilder<TProjection> Aggregate<TProjection>() where TProjection : class, new()Creates an aggregation builder where the collection is inferred from the [QueryAggregate<T>] attribute on the projection type. Uses raw Filter for filtering (since the model type is only known at runtime). .Execute() is optional - the builder is directly awaitable.
// Execute() is optional
var stats = await context.Aggregate<ProductStats>();
// With grouping - returns GroupedContextAggregateBuilder<TProjection>
var grouped = await context.Aggregate<ProductStats>()
.GroupBy("category");CollectionMapperQueryClient<T> Query<T>() where T : class, new()Creates a query builder for the specified type.
var results = await context.Query<Book>().Where(b => b.Price > 10).Execute();Task<ulong> Count<T>(CancellationToken ct = default) where T : class, new()Returns the total number of objects in the collection.
var bookCount = await context.Count<Book>();IAsyncEnumerable<T> Iterator<T>(Guid? after = null, uint cacheSize = 100,
CancellationToken ct = default) where T : class, new()Iterates over all objects using cursor-based pagination.
await foreach (var book in context.Iterator<Book>())
{
Console.WriteLine(book.Title);
}CollectionSet<T> Set<T>() where T : class, new()Gets the CollectionSet<T> for a type. If the type is declared as a property on the context, returns that instance; otherwise creates a new one.
Task<Dictionary<string, MigrationPlan>> GetPendingMigrations(CancellationToken ct = default)Returns migration plans for all collections in the context. Also detects orphaned collections (server collections not registered in the context).
Task Migrate(bool allowBreakingChanges = false, bool destructive = false, CancellationToken ct = default)Migrates all collections to match their type definitions. When destructive: true, also deletes orphaned server collections not registered in the context.
WeaviateContext ForTenant(string tenant)Returns a new context scoped to the specified tenant. The original context is unchanged. The returned context is the same derived type with independent CollectionSet<T> instances.
var acmeContext = (BookstoreContext)context.ForTenant("acme");
await acmeContext.Books.Insert(new Book { Title = "Acme Guide" });WeaviateContext WithConsistencyLevel(ConsistencyLevels level)Returns a new context with the specified consistency level.
var quorumContext = context.WithConsistencyLevel(ConsistencyLevels.Quorum);protected virtual void OnConfiguring(WeaviateContextOptionsBuilder options)Override to configure context options.
Per-collection facade, similar to EF Core's DbSet<T>. Provides all CRUD, query, aggregate, count, iterator, and migration operations for a single entity type.
| Property | Type | Description |
|---|---|---|
CollectionName |
string |
The Weaviate collection name |
Task<T> Insert(T entity, CancellationToken ct = default)Inserts a single entity and returns it with its [WeaviateUUID] property populated.
PendingInsert<T> Insert(params T[] entities)Creates a pending batch insert. Can be directly awaited or chained. See PendingInsert<T>.
Throws BatchInsertException<T> on failure.
Task<T> Update(T entity, CancellationToken ct = default)Updates a single entity (PATCH semantics) and returns it. Uses the entity's [WeaviateUUID] property.
PendingUpdate<T> Update(params T[] entities)Updates multiple entities using their [WeaviateUUID] properties (PATCH semantics). Directly awaitable. See PendingUpdate<T>.
Task<T> Replace(T entity, CancellationToken ct = default)Replaces an entity entirely (PUT semantics) and returns it. Uses the entity's [WeaviateUUID].
PendingDelete<T> Delete(params Guid[] ids)Deletes entities by ID. Directly awaitable or chainable. See PendingDelete<T>.
PendingDelete<T> Delete(params T[] entities)Deletes entities using their [WeaviateUUID] property. Directly awaitable or chainable.
Task DeleteMany(IEnumerable<T> entities, CancellationToken ct = default)Batch deletes entities using Filter.UUID.ContainsAny.
Task DeleteMany(Expression<Func<T, bool>> filter, CancellationToken ct = default)Deletes entities matching a filter expression.
PendingReference<T> AddReference<TRef>(T entity,
Expression<Func<T, object?>> property, TRef target)Adds a cross-reference link from entity.property to target (entity or Guid). Directly awaitable or chainable. See PendingReference<T>.
// Directly awaitable
await context.Articles.AddReference(article, a => a.Category, techCategory);
// Chained — sent in one call
await context.Articles
.AddReference(article1, a => a.Category, techCategory)
.AddReference(article2, a => a.Category, scienceCategory)
.Execute(cancellationToken);Task ReplaceReferences<TRef>(T entity,
Expression<Func<T, object?>> property, params TRef[] targets)Replaces all values of the reference property with the supplied targets (entities or Guids).
await context.Articles.ReplaceReferences(article, a => a.Category, newCategoryId);
await context.Articles.ReplaceReferences(article, a => a.Tags, tag1Id, tag2Id, tag3Id);Task DeleteReference<TRef>(T entity,
Expression<Func<T, object?>> property, TRef target)Removes a specific cross-reference link.
await context.Articles.DeleteReference(article, a => a.Category, oldCategoryId);
await context.Articles.DeleteReference(article, a => a.Category, oldCategory);CollectionMapperQueryClient<T> Query()Creates a query builder.
ProjectedQueryClient<T, TProjection> Project<TProjection>() where TProjection : class, new()Creates a projected query that maps results to TProjection.
Task<T?> Find(Guid id, CancellationToken ct = default)Finds an entity by ID. Returns null if not found.
var book = await context.Books.Find(bookId);AggregateStarter<T> Aggregate()Creates an aggregation builder. All aggregate operations support optional .Execute() - builders are directly awaitable.
// Execute() is optional
var stats = await products.Aggregate.WithMetrics<ProductStats>();
// Grouped aggregation - returns GroupedAggregateBuilder<T, TResult>
var grouped = await products.Aggregate
.WithMetrics<ProductStats>()
.GroupBy(p => p.Category);Task<ulong> Count(CancellationToken ct = default)Returns the total number of objects in the collection.
IAsyncEnumerable<T> Iterator(Guid? after = null, uint cacheSize = 100,
CancellationToken ct = default)Iterates over all objects using cursor-based pagination.
Task<MigrationPlan> CheckMigrate(CancellationToken ct = default)Dry-run migration check.
Task<MigrationPlan> Migrate(bool checkFirst = true, bool allowBreakingChanges = false,
CancellationToken ct = default)Migrates the collection schema.
Lower-level type-safe wrapper around CollectionClient. Use this when you don't need a full context.
| Property | Type | Description |
|---|---|---|
Inner |
CollectionClient |
Underlying Weaviate collection client |
Name |
string |
Collection name |
Tenant |
string? |
Current tenant scope |
Task<Guid> Insert(T obj, Guid? id = null, CancellationToken ct = default)Returns the UUID of the inserted object.
Task<BatchInsertResponse> InsertMany(IEnumerable<T> objects, CancellationToken ct = default)Low-level batch insert returning the core BatchInsertResponse.
Task Replace(T obj, Guid id, CancellationToken ct = default)Full replacement (PUT).
Task Update(T obj, Guid id, CancellationToken ct = default)Partial update (PATCH).
Task Delete(Guid id, CancellationToken ct = default)Task<DeleteManyResult> DeleteMany(Expression<Func<T, bool>> where,
bool dryRun = false, bool verbose = false, CancellationToken ct = default)| Property | Type | Description |
|---|---|---|
Query |
CollectionMapperQueryClient<T> |
Query builder |
Aggregate |
AggregateStarter<T> |
Aggregate builder |
Task<ulong> Count(CancellationToken ct = default)IAsyncEnumerable<T> Iterator(Guid? after = null, uint cacheSize = 100,
CancellationToken ct = default)Cursor-based iteration over all objects.
Task<bool> Exists(CancellationToken ct = default)Task DeleteCollection(CancellationToken ct = default)Task<CollectionConfigExport?> ExportConfig(CancellationToken ct = default)ManagedCollection<T> WithTenant(string tenant)ManagedCollection<T> WithConsistencyLevel(ConsistencyLevels level)Same signatures as CollectionSet<T>.
Fluent query builder with LINQ-style methods.
CollectionMapperQueryClient<T> Where(Expression<Func<T, bool>> predicate)Multiple calls are combined with AND.
Supported operators:
- Comparison:
==,!=,>,<,>=,<= - Logical:
&&,||,! - String:
.Contains(),.StartsWith(),.EndsWith() - Null:
== null,!= null - Collections:
.Contains()on arrays - Geo range:
.IsWithinGeoRange(lat, lon, distanceMetres)or.IsWithinGeoRange(GeoCoordinateConstraint)onGeoCoordinateproperties
CollectionMapperQueryClient<T> NearText(string text,
Expression<Func<T, object>>? vector = null,
float? certainty = null, float? distance = null)Semantic search via text-to-vector conversion.
CollectionMapperQueryClient<T> NearVector(float[] vectorValues,
Expression<Func<T, object>>? vector = null,
float? certainty = null, float? distance = null)Search with a provided vector.
CollectionMapperQueryClient<T> NearObject(Guid objectId,
Expression<Func<T, object>>? vector = null,
float? certainty = null, float? distance = null)Search using an existing object's vector.
CollectionMapperQueryClient<T> Hybrid(string query,
Expression<Func<T, object>>? vector = null,
float? alpha = null, HybridFusion? fusionType = null,
float? maxVectorDistance = null)Combined BM25 + vector search. alpha controls balance (0 = keyword, 1 = vector).
CollectionMapperQueryClient<T> BM25(string query,
Expression<Func<T, object>>[]? searchFields = null,
BM25Operator? searchOperator = null)Keyword search. Optionally restrict to specific fields.
.BM25("wireless mouse")
.BM25("wireless", searchFields: [p => p.Name], searchOperator: BM25Operator.And)CollectionMapperQueryClient<T> NearMedia(NearMediaInput.FactoryFn media)Multi-modal search (image, video, audio).
.NearMedia(m => m.Image(imageBytes).Build())CollectionMapperQueryClient<T> Targets(Func<TargetVectorBuilder<T>, TargetVectorBuilder<T>> configure)Configures multi-vector targeting for collections with multiple named vectors. Works with NearText, NearVector, NearObject, and Hybrid.
Combination Methods:
Sum()— Add vector distancesAverage()— Average vector distancesMinimum()— Use closest distance (best match wins)ManualWeights()— Apply explicit weights to each vectorRelativeScore()— Score-based weighting
// Named vector combination (NearText/NearObject/Hybrid)
var results = await products.Query()
.NearText("wireless mouse")
.Targets(t => t.Sum(p => p.TextEmbedding, p => p.ImageEmbedding))
.Execute();
// With weights
var results = await products.Query()
.NearText("laptop")
.Targets(t => t.ManualWeights(
(p => p.TextEmbedding, 0.7),
(p => p.ImageEmbedding, 0.3)
))
.Execute();
// Per-target vectors (NearVector)
var textVec = new float[] { 0.1f, 0.2f };
var imageVec = new float[] { 0.3f, 0.4f };
var results = await products.Query()
.NearVector()
.Targets(t => t.Sum(
(p => p.TextEmbedding, textVec),
(p => p.ImageEmbedding, imageVec)
))
.Execute();CollectionMapperQueryClient<T> Limit(uint limit)
CollectionMapperQueryClient<T> Offset(uint offset)
CollectionMapperQueryClient<T> AutoLimit(uint autoLimit)
CollectionMapperQueryClient<T> After(Guid cursor)CollectionMapperQueryClient<T> OrderBy<TProp>(Expression<Func<T, TProp>> property)
CollectionMapperQueryClient<T> OrderByDescending<TProp>(Expression<Func<T, TProp>> property)
CollectionMapperQueryClient<T> ThenBy<TProp>(Expression<Func<T, TProp>> property)
CollectionMapperQueryClient<T> ThenByDescending<TProp>(Expression<Func<T, TProp>> property)Preferred chaining API for multi-column sort.
.OrderBy(p => p.Category)
.ThenByDescending(p => p.Price)CollectionMapperQueryClient<T> Sort<TProp>(
Expression<Func<T, TProp>> property, bool descending = false)Low-level single-column sort. OrderBy/ThenBy are preferred for chaining.
CollectionMapperQueryClient<T> Rerank(Rerank rerank)
CollectionMapperQueryClient<T> Rerank(string property, string? query = null)Re-ranks results using the collection's configured reranker module. The string overload specifies which property the reranker should score on, and an optional separate rerank query.
// Rerank on property with explicit query
.Rerank("name", "wireless headphones")
// Rerank on property using the search query
.Rerank("description")
// Full control
.Rerank(new Rerank { Property = "name", Query = "gaming mouse" })CollectionMapperQueryClient<T> WithVectors(params Expression<Func<T, object>>[] vectors)CollectionMapperQueryClient<T> WithReferences(params Expression<Func<T, object>>[] references)CollectionMapperQueryClient<T> Select(Expression<Func<T, object>> selector)Return only specific properties.
ProjectedQueryClient<T, TProjection> Project<TProjection>() where TProjection : class, new()Project results to a different type. See Query Projections.
CollectionMapperQueryClient<T> WithMetadata(MetadataQuery metadata)Task<IEnumerable<QueryResult<T>>> Execute(CancellationToken ct = default)Returns results wrapped in QueryResult<T> with .Object, .Id, and .Metadata.
var results = await collection.Query().NearText("widget").Execute();
foreach (var result in results)
Console.WriteLine($"{result.Object.Name}: {result.Metadata?.Score}");
// Extract just objects
var objects = results.Objects();GenerativeQueryExecutor<T> Generate(
SinglePrompt? singlePrompt = null,
GroupedTask? groupedTask = null,
GenerativeProvider? provider = null)Switches to generative (RAG) mode. See GenerativeQueryExecutor.
Fluent builder for generative (RAG) queries. Returned by .Generate() on the query builder.
GenerativeQueryExecutor<T> SinglePrompt(string prompt)Per-object generation. Supports {propertyName} template substitution.
GenerativeQueryExecutor<T> GroupedTask(string task, params string[] properties)Result-set level generation. All results are provided as context.
GenerativeQueryExecutor<T> WithProvider(GenerativeProvider provider)Override the collection's configured generative module.
Task<GenerativeQueryResponse<T>> Execute(CancellationToken ct = default)Returns a GenerativeQueryResponse<T> containing per-object and grouped generative results.
// Per-object generation
var results = await products.Query
.NearText("wireless mouse")
.Limit(5)
.Generate(singlePrompt: "Describe this product")
.Execute();
foreach (var r in results)
Console.WriteLine($"{r.Object.Name}: {r.Generative?[0]}");
// Grouped generation
var grouped = await products.Query
.NearText("wireless mouse")
.Limit(5)
.Generate()
.GroupedTask("Compare these products")
.Execute();
Console.WriteLine(grouped.Generative?[0]);
// Both prompts
var both = await products.Query
.NearText("wireless mouse")
.Limit(5)
.Generate(singlePrompt: "Summarize: {name}")
.GroupedTask("Which is best?")
.Execute();Administrative operations facade. Accessed via context.Admin.
| Property | Type | Description |
|---|---|---|
Backup |
BackupClient |
Backup and restore operations |
Users |
UsersClient |
User management |
Roles |
RolesClient |
Role management and permissions |
Groups |
GroupsClient |
OIDC group management |
Cluster |
ClusterClient |
Cluster and replication |
Aliases |
AliasClient |
Collection alias management |
Task<bool> IsLive(CancellationToken ct = default)
Task<bool> IsReady(CancellationToken ct = default)
Task<bool> WaitUntilReady(TimeSpan timeout, TimeSpan? pollInterval = null, CancellationToken ct = default)
Task<MetaInfo> GetMeta(CancellationToken ct = default)// Health check
var ready = await context.Admin.IsReady();
// Server metadata
var meta = await context.Admin.GetMeta();
Console.WriteLine($"Weaviate {meta.Version}");
// Backup
await context.Admin.Backup.CreateSync(backupRequest);
// RBAC
var roles = await context.Admin.Roles.ListAll();A fluent pending-insert builder returned by CollectionSet<T>.Insert(params T[]).
Can be directly awaited or chained with additional .Insert() calls before calling .Execute(ct).
PendingInsert<T> Insert(params T[] entities)Adds another batch to be executed sequentially after the previous ones.
Task<T[]> Execute(CancellationToken ct = default)Executes all accumulated batches in order. IDs are assigned back to entities.
Throws BatchInsertException<T> if any batch has failures.
// Directly awaitable
var books = await context.Books.Insert(b1, b2, b3);
// Explicit CancellationToken
var books = await context.Books.Insert(b1, b2, b3).Execute(cancellationToken);
// Chained — second InsertMany runs after the first completes
// (useful for same-collection references)
var allBooks = await context.Books
.Insert(b1, b2, b3) // first InsertMany
.Insert(b4) // second InsertMany — b4 may reference b1/b2/b3
.Execute(cancellationToken);A fluent pending-delete builder returned by CollectionSet<T>.Delete(params T[]) and CollectionSet<T>.Delete(params Guid[]). Can be directly awaited or chained to accumulate IDs before a single batch call.
PendingDelete<T> Delete(params T[] entities)Accumulates additional entities to delete.
PendingDelete<T> Delete(params Guid[] ids)Accumulates additional IDs to delete.
Task Execute(CancellationToken ct = default)Sends all accumulated IDs in a single batch delete call.
// Directly awaitable
await context.Products.Delete(p1, p2, p3);
// Chained accumulation — all deleted in one batch call
await context.Products
.Delete(p1, p2)
.Delete(p3, p4)
.Execute(cancellationToken);
// Mix entities and raw IDs
await context.Products
.Delete(p1, p2)
.Delete(oldId1, oldId2)
.Execute(cancellationToken);A fluent pending-update builder returned by CollectionSet<T>.Update(params T[]). Directly awaitable.
Task<T[]> Execute(CancellationToken ct = default)Executes all pending updates and returns the updated entities.
// Directly awaitable — returns updated entities
var updated = await context.Products.Update(p1, p2, p3);
// Explicit CancellationToken
var updated = await context.Products.Update(p1, p2, p3).Execute(cancellationToken);A fluent pending-reference builder returned by CollectionSet<T>.AddReference(...). All accumulated links are sent in a single ReferenceAddMany call when executed. Directly awaitable or chainable.
PendingReference<T> AddReference<TRef>(T entity,
Expression<Func<T, object?>> property, TRef target)Accumulates an additional reference link to add.
Task Execute(CancellationToken ct = default)Sends all accumulated links in a single ReferenceAddMany call.
// Directly awaitable — single link
await context.Articles.AddReference(article, a => a.Category, techCategory);
// Chained — all links sent in one call
await context.Articles
.AddReference(article1, a => a.Category, techCategory)
.AddReference(article2, a => a.Category, scienceCategory)
.Execute(cancellationToken);
// Mix entity and Guid targets
await context.Articles
.AddReference(article, a => a.Category, category)
.AddReference(article, a => a.AuthorId, existingAuthorGuid)
.Execute(cancellationToken);Entry point for aggregation queries.
AggregateBuilder<T, TMetrics> WithMetrics<TMetrics>() where TMetrics : class, new()Aggregate properties use Aggregate types from Weaviate.Client.Models.Typed with [Metrics] attributes to specify which metrics to compute. Returns TypedAggregateBuilder<T, TMetrics> which is directly awaitable (.Execute() optional).
using Weaviate.Client.Models.Typed;
using Weaviate.Client.Managed.Attributes;
public class ProductStats
{
[Metrics(Metric.Number.Mean, Metric.Number.Min, Metric.Number.Max, Metric.Number.Count)]
public Aggregate.Number Price { get; set; }
}
// Execute() is optional - directly awaitable
var stats = await products.Aggregate()
.WithMetrics<ProductStats>();
Console.WriteLine($"Average: {stats.Properties.Price.Mean:C}");
// GroupBy returns GroupedAggregateBuilder<T, TResult>
var grouped = await products.Aggregate()
.WithMetrics<ProductStats>()
.GroupBy(p => p.Category);
foreach (var group in grouped.Groups)
{
Console.WriteLine($"{group.GroupedBy.Value}: {group.Properties.Price.Mean:C}");
}Task<ManagedCollection<T>> CreateManaged<T>(this CollectionsClient collections, ...)Creates a collection from type attributes and returns a managed wrapper.
Task<CollectionClient> CreateFromClass<T>(this CollectionsClient collections, ...)Creates a collection from type attributes, returns raw CollectionClient.
ManagedCollection<T> UseManaged<T>(this CollectionsClient collections)Gets an existing collection and wraps it in a managed wrapper. Collection name is resolved from [WeaviateCollection] attribute.
Example:
// Compact syntax - infers collection name from attribute
var products = client.Collections.UseManaged<Product>();
// Equivalent to the verbose form:
var products = client.Collections.Use("Products").AsManaged<Product>();Task<ManagedCollection<T>> Managed<T>(this CollectionsClient collections, ...)Gets an existing collection with existence checking and returns a managed wrapper.
ManagedCollection<T> AsManaged<T>(this CollectionClient collection)Wraps an existing collection client.
CollectionMapperQueryClient<T> Query<T>(this CollectionClient collection)Creates a query builder for an existing collection.
IEnumerable<T> Objects<T>(this IEnumerable<QueryResult<T>> results)
IEnumerable<QueryResult<T>> WithMetadata<T>(this IEnumerable<QueryResult<T>> results)
IOrderedEnumerable<QueryResult<T>> OrderByScore<T>(this IEnumerable<QueryResult<T>> results)
IOrderedEnumerable<QueryResult<T>> OrderByDistance<T>(this IEnumerable<QueryResult<T>> results)public record QueryResult<T>
{
public Guid Id { get; init; }
public T Object { get; init; }
public Metadata? Metadata { get; init; }
}public record GenerativeQueryResult<T> : QueryResult<T>
{
public GenerativeResult? Generative { get; init; }
}public record GenerativeQueryResponse<T> : IEnumerable<GenerativeQueryResult<T>>
{
public IList<GenerativeQueryResult<T>> Results { get; init; }
public GenerativeResult? Generative { get; init; } // Grouped task result
}GenerativeResult implements IList<string>, so result.Generative?[0] returns the generated text.
Project query results to a subset of properties using a projection type:
[QueryProjection<Article>]
public class ArticleSummary
{
[WeaviateUUID]
public Guid Id { get; set; }
public string Title { get; set; } = "";
[MapFrom("WordCount")]
public int Words { get; set; }
}
var results = await context.Query<Article>()
.Project<ArticleSummary>()
.Limit(10)
.Execute();public class MigrationPlan
{
public string CollectionName { get; }
public List<SchemaChange> Changes { get; }
public bool HasChanges { get; }
public bool IsCreate { get; }
public bool IsSafe { get; }
public bool IsOrphaned { get; }
public string GetSummary();
public static MigrationPlan ForOrphanedCollection(string collectionName);
}public class SchemaChange
{
public SchemaChangeType ChangeType { get; }
public string Description { get; }
public bool IsSafe { get; }
}