You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -728,3 +732,77 @@ var cardId = await crud.AddAsync("Cards", new Dictionary<string, object>
728
732
{ "DriverId", driverId } // auto-converted to DocumentReference based on schema
729
733
});
730
734
```
735
+
736
+
<hr/>
737
+
738
+
## Minimal Working Example
739
+
740
+
Here is a minimal working example that demonstrates how to use the Firestore CRUD implementation in a .NET application. This example includes connecting to Firestore, defining collection schemas, and performing CRUD operations.
741
+
742
+
```cs
743
+
// --- 1. Connect to Firestore using Service Account (NEW METHOD) ---
744
+
Console.WriteLine("Connecting to Firestore...");
745
+
746
+
stringprojectId="brickssimpledatabase";
747
+
stringcredentialPath="admin.json"; // <-- MAKE SURE THIS FILE IS IN YOUR RUN DIRECTORY
748
+
749
+
FirestoreDbdb;
750
+
try
751
+
{
752
+
// Open the file as a stream
753
+
using (varstream=newFileStream(credentialPath, FileMode.Open, FileAccess.Read))
0 commit comments