Firewatch 1.0.1
dotnet add package Firewatch --version 1.0.1
NuGet\Install-Package Firewatch -Version 1.0.1
<PackageReference Include="Firewatch" Version="1.0.1" />
<PackageVersion Include="Firewatch" Version="1.0.1" />
<PackageReference Include="Firewatch" />
paket add Firewatch --version 1.0.1
#r "nuget: Firewatch, 1.0.1"
#:package Firewatch@1.0.1
#addin nuget:?package=Firewatch&version=1.0.1
#tool nuget:?package=Firewatch&version=1.0.1
🔥 FirrestoreEasyAccess for .NET
A lightweight C# wrapper for Google Firestore using the REST API. Includes full CRUD support, polling-based live monitoring, and strong typing via generics.
📦 Installation
Just copy the following files into your project:
- Install via NuGet Package Manager
- via .NET CLI
🚀 Quick Start
Setup
var projectId = "ProjectID"; // 🔁 Replace this with your actual Firestore project ID
var repo = new FirestoreRepisory(projectId);
Example class
public class User {
public string Name { get; set; }
public int Age { get; set; }
public bool IsActive { get; set; }
}
Create with automatic ID
await repo.CreateAsync("Users", user);
Create with an ID
var documentID = Guid.NewGuid().ToString().Replace("-", string.Empty);
await repo.CreateAsync("users" ,documentID, user);
Read using an ID
var documntId = "51e3d934104948d39009c48976a030c7";
await repo.ReadAsync<User>("users", documntId);
Read all (returns a list)
var users = await repo.ReadAllAsync<User>("users");
Update
user.Name = "Gerald";
var documentId = "51e3d934104948d39009c48976a030c7";
await repo.UpdateAsync<User>("users", documentId, user);
Delete
var documentId = "51e3d934104948d39009c48976a030c7";
await repo.DeleteAsync("users" ,documentId);
🛠️ Helpers
🔁 Monitor a Single Document
Use MonitorDocumentAsync to continuously monitor changes in a specific document. The onDataChanged callback is triggered only when the data actually changes.
await repo.MonitorDocumentAsync<User>(
"users",
"abc123",
user => {
Console.WriteLine($"🟢 Updated user: {user?.Name}");
},
intervalSeconds: 3
);
📡 Monitor a Collection in Real-Time
Use MonitorCollectionAsync to automatically keep an ObservableCollection<T> synchronized with a Firestore collection.
ObservableCollection<User> users = new();
await repo.MonitorCollectionAsync<User>(
"users",
users,
intervalSeconds: 5
);
📘 Method Parameters Table
| Method | Parameters | Description |
|---|---|---|
CreateAsync<T>(collection, entity) |
collection (string): Firestore collection name <br> entity (T): Object to store |
Creates a document with an auto-generated ID in the specified collection. |
CreateAsync<T>(collection, id, entity) |
collection (string): Firestore collection name <br> id (string): Document ID <br> entity (T): Object to store |
Creates a document with a custom ID in the specified collection. |
ReadAsync<T>(collection, id) |
collection (string): Firestore collection name <br> id (string): Document ID |
Reads a single document by ID. |
ReadAllAsync<T>(collection) |
collection (string): Firestore collection name |
Retrieves all documents from the collection. |
UpdateAsync<T>(collection, id, entity) |
collection (string): Firestore collection name <br> id (string): Document ID <br> entity (T): Updated object |
Updates an existing document with new values. |
DeleteAsync(collection, id) |
collection (string): Firestore collection name <br> id (string): Document ID |
Deletes a document from the specified collection. |
MonitorDocumentAsync<T>(collection, id, callback, interval) |
collection (string) <br> id (string) <br> callback (Action<T?>): Triggered on change <br> interval (int): Seconds between checks |
Monitors a single document for changes using polling. |
MonitorCollectionAsync<T>(collection, observable, interval) |
collection (string) <br> observable (ObservableCollection<T>) <br> interval (int): Seconds between checks |
Keeps a collection in sync with Firestore data changes. |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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. |
-
net9.0
- No dependencies.
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 |
|---|