public static DocumentSnapshot.ServerTimestampBehavior ToNative(this ServerTimestampBehavior serverTimestampBehavior)
        {
            switch (serverTimestampBehavior)
            {
            case ServerTimestampBehavior.None:
                return(DocumentSnapshot.ServerTimestampBehavior.None);

            case ServerTimestampBehavior.Estimate:
                return(DocumentSnapshot.ServerTimestampBehavior.Estimate);

            case ServerTimestampBehavior.Previous:
                return(DocumentSnapshot.ServerTimestampBehavior.Previous);

            default:
                throw new ArgumentOutOfRangeException(nameof(serverTimestampBehavior));
            }
        }
        public static Firebase.CloudFirestore.ServerTimestampBehavior ToNative(this ServerTimestampBehavior serverTimestampBehavior)
        {
            switch (serverTimestampBehavior)
            {
            case ServerTimestampBehavior.None:
                return(Firebase.CloudFirestore.ServerTimestampBehavior.None);

            case ServerTimestampBehavior.Estimate:
                return(Firebase.CloudFirestore.ServerTimestampBehavior.Estimate);

            case ServerTimestampBehavior.Previous:
                return(Firebase.CloudFirestore.ServerTimestampBehavior.Previous);

            default:
                throw new ArgumentOutOfRangeException(nameof(serverTimestampBehavior));
            }
        }
Exemplo n.º 3
0
 public IEnumerable <T> ToObjects <T>(ServerTimestampBehavior serverTimestampBehavior)
 {
     return(Documents.Select(d => d.ToObject <T>(serverTimestampBehavior)));
 }
 public T Get <T>(FieldPath field, ServerTimestampBehavior serverTimestampBehavior)
 {
     return((T)_documentSnapshot.GetValue(field?.ToNative(), serverTimestampBehavior.ToNative()).ToFieldValue(new DocumentFieldInfo <T>()));
 }
 public T ToObject <T>(ServerTimestampBehavior serverTimestampBehavior)
 {
     return(DocumentMapper.Map <T>(_documentSnapshot, serverTimestampBehavior));
 }
 public IDictionary <string, object?>?GetData(ServerTimestampBehavior serverTimestampBehavior)
 {
     return(Exists ? DocumentMapper.Map(_documentSnapshot, serverTimestampBehavior) : null);
 }