クラスの作成
[FirestoreData]
public class FSData
{
[FirestoreProperty]
public Timestamp AccessDate { get; set; }
[FirestoreProperty]
public double IdNumber { get; set; }
[FirestoreProperty]
public string Name { get; set; }
}
データを追加
FSData fSData = new FSData
{
AccessDate = Timestamp.GetCurrentTimestamp(),
IdNumber = DateTime.Now.Millisecond,
Name = "TEST 03"
};
;
string documentName = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
Google.Cloud.Firestore.DocumentReference docRef = db.Collection("users").Document(documentName);
await docRef.SetAsync(fSData);