public sealed class PartitionId : IMessage<PartitionId>, IEquatable<PartitionId>, IDeepCloneable<PartitionId>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Datastore v1 API class PartitionId.
A partition ID identifies a grouping of entities. The grouping is always
by project and namespace, however the namespace ID may be empty.
A partition ID contains several dimensions:
project ID and namespace ID.
Partition dimensions:
May be "".
Must be valid UTF-8 bytes.
Must have values that match regex [A-Za-z\d\.\-_]{1,100}
If the value of any dimension matches regex __.*__, the partition is
reserved/read-only.
A reserved/read-only partition ID is forbidden in certain documented
contexts.
Foreign partition IDs (in which the project ID does
not match the context project ID ) are discouraged.
Reads and writes of foreign partition IDs may fail if the project is not in
an active state.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis webpage provides documentation for the \u003ccode\u003ePartitionId\u003c/code\u003e class within the Google Cloud Datastore v1 API for .NET, including various versions ranging from 3.2.0 to the latest 4.15.0.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePartitionId\u003c/code\u003e is used to identify a grouping of entities, structured by project and namespace IDs, where the namespace ID can be empty and must adhere to UTF-8 byte encoding and regex formatting.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ePartitionId\u003c/code\u003e class implements interfaces like \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and it provides constructors to create partition IDs using project, namespace, and database IDs.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ePartitionId\u003c/code\u003e class contains properties like \u003ccode\u003eDatabaseId\u003c/code\u003e, \u003ccode\u003eNamespaceId\u003c/code\u003e, and \u003ccode\u003eProjectId\u003c/code\u003e, which represent the respective IDs for the database, namespace, and project to which the entities belong.\u003c/p\u003e\n"],["\u003cp\u003eForeign partition IDs are generally discouraged and reads and writes to them may fail if the project isn't active.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Datastore v1 API - Class PartitionId (4.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.15.0 (latest)](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.PartitionId)\n- [4.14.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.14.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.13.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.13.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.12.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.12.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.11.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.11.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.10.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.10.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.9.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.9.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.8.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.8.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.7.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.7.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.6.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.5.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.4.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.3.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.2.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.1.0/Google.Cloud.Datastore.V1.PartitionId)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.0.0/Google.Cloud.Datastore.V1.PartitionId)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.5.0/Google.Cloud.Datastore.V1.PartitionId)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.4.0/Google.Cloud.Datastore.V1.PartitionId)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.3.0/Google.Cloud.Datastore.V1.PartitionId)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.2.0/Google.Cloud.Datastore.V1.PartitionId) \n\n public sealed class PartitionId : IMessage\u003cPartitionId\u003e, IEquatable\u003cPartitionId\u003e, IDeepCloneable\u003cPartitionId\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Datastore v1 API class PartitionId.\n\nA partition ID identifies a grouping of entities. The grouping is always\nby project and namespace, however the namespace ID may be empty.\n\nA partition ID contains several dimensions:\nproject ID and namespace ID.\n\nPartition dimensions:\n\n- May be `\"\"`.\n- Must be valid UTF-8 bytes.\n- Must have values that match regex `[A-Za-z\\d\\.\\-_]{1,100}` If the value of any dimension matches regex `__.*__`, the partition is reserved/read-only. A reserved/read-only partition ID is forbidden in certain documented contexts.\n\nForeign partition IDs (in which the project ID does\nnot match the context project ID ) are discouraged.\nReads and writes of foreign partition IDs may fail if the project is not in\nan active state. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e PartitionId \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[PartitionId](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.PartitionId), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[PartitionId](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.PartitionId), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[PartitionId](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.PartitionId), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Datastore.V1](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Datastore.V1.dll\n\nConstructors\n------------\n\n### PartitionId()\n\n public PartitionId()\n\n### PartitionId(PartitionId)\n\n public PartitionId(PartitionId other)\n\n### PartitionId(string, string)\n\n public PartitionId(string projectId, string namespaceId = \"\")\n\nCreates a partition ID from the given project ID and namespace ID.\n\n### PartitionId(string, string, string)\n\n public PartitionId(string projectId, string namespaceId, string databaseId)\n\nCreates a partition ID from the given project ID , namespace ID and database ID.\n\nProperties\n----------\n\n### DatabaseId\n\n public string DatabaseId { get; set; }\n\nIf not empty, the ID of the database to which the entities\nbelong.\n\n### NamespaceId\n\n public string NamespaceId { get; set; }\n\nIf not empty, the ID of the namespace to which the entities belong.\n\n### ProjectId\n\n public string ProjectId { get; set; }\n\nThe ID of the project to which the entities belong."]]