public static async Task <object> UpdateAsync(this IFirebaseAdminRef firebaseRef, Dictionary <string, object> content) { if (content == null || content.Count == 0) { throw new ArgumentNullException(nameof(content)); } return(await firebaseRef.HttpClient.UpdatePathAsync(firebaseRef.Path, content)); }
public static async Task <string> PushAsync <T>(this IFirebaseAdminRef firebaseRef, T content) { if (content == null) { throw new ArgumentNullException(nameof(content)); } return(await firebaseRef.HttpClient.PushToPathAsync(firebaseRef.Path, content)); }
public static IFirebaseAdminRef OrderBy(this IFirebaseAdminRef firebaseRef, string value) { if (string.IsNullOrWhiteSpace(value)) { throw new ArgumentNullException(nameof(value)); } firebaseRef.Add("orderBy", $"\"{value}\""); return(firebaseRef); }
private static Uri PrepareUri(IFirebaseAdminRef firebaseRef) { var queryStore = firebaseRef.GetQueryStore(); var queryParams = new StringBuilder("?"); foreach (var param in queryStore) { queryParams.Append($"{param.Key}={param.Value}&"); } return(new Uri(firebaseRef.Path + queryParams, UriKind.Relative)); }
public static IFirebaseAdminRef StartAt(this IFirebaseAdminRef firebaseRef, bool value) { firebaseRef.AddBool(StartAtValue, value); return(firebaseRef); }
public static IFirebaseAdminRef StartAt(this IFirebaseAdminRef firebaseRef, string value) { firebaseRef.AddString(StartAtValue, value); return(firebaseRef); }
public static IFirebaseAdminRef EndAt(this IFirebaseAdminRef firebaseRef, decimal value) { firebaseRef.Add(EndAtValue, value.ToString()); return(firebaseRef); }
public async static Task <IList <T> > GetWithKeyInjectedAsync <T>(this IFirebaseAdminRef firebaseRef) where T : KeyEntity { var uri = PrepareUri(firebaseRef); return(await firebaseRef.HttpClient.GetFromPathAsyncWithKeyInjected <T>(uri)); }
public static object Update(this IFirebaseAdminRef firebaseRef, Dictionary <string, object> content) => firebaseRef.HttpClient.UpdatePathAsync(firebaseRef.Path, content).Result;
public static T Get <T>(this IFirebaseAdminRef firebaseRef) => GetAsync <T>(firebaseRef).Result;
public static IFirebaseAdminRef LimitToLast(this IFirebaseAdminRef firebaseRef, long value) { firebaseRef.Add("limitToLast", value.ToString()); return(firebaseRef); }
public static IFirebaseAdminRef EqualTo(this IFirebaseAdminRef firebaseRef, bool value) { firebaseRef.AddBool(EqualToValue, value); return(firebaseRef); }
public static T Set <T>(this IFirebaseAdminRef firebaseRef, T content) => SetAsync(firebaseRef, content).Result;
public static List <T> GetArrayWithKeyInjected <T>(this IFirebaseAdminRef firebaseRef) where T : KeyEntity => GetArrayWithKeyInjectedAsync <T>(firebaseRef).Result;
public static async Task <List <T> > GetArrayWithKeyInjectedAsync <T>(this IFirebaseAdminRef firebaseRef) where T : KeyEntity => await firebaseRef.HttpClient.GetArrayFromPathAsyncWithKeyInjected <T>(PrepareUri(firebaseRef));
public static async Task <List <T> > GetArrayAsync <T>(this IFirebaseAdminRef firebaseRef) => await firebaseRef.HttpClient.GetArrayFromPathAsync <T>(PrepareUri(firebaseRef));
public static List <T> GetArray <T>(this IFirebaseAdminRef firebaseRef) => GetArrayAsync <T>(firebaseRef).Result;
public static IFirebaseAdminRef StartAt(this IFirebaseAdminRef firebaseRef, int value) { firebaseRef.Add(StartAtValue, value.ToString()); return(firebaseRef); }
public static string Push <T>(this IFirebaseAdminRef firebaseRef, T content) => PushAsync(firebaseRef, content).Result;
public static T Set <T>(this IFirebaseAdminRef firebaseRef, T content) { return(SetAsync(firebaseRef, content).Result); }
public async static Task <T> GetAsync <T>(this IFirebaseAdminRef firebaseRef) { var uri = PrepareUri(firebaseRef); return(await firebaseRef.HttpClient.GetFromPathAsync <T>(uri)); }
public static IFirebaseAdminRef EqualTo(this IFirebaseAdminRef firebaseRef, string value) { firebaseRef.AddString(EqualToValue, value); return(firebaseRef); }
public static IList <T> GetWithKeyInjected <T>(this IFirebaseAdminRef firebaseRef) where T : KeyEntity { return(GetWithKeyInjectedAsync <T>(firebaseRef).Result); }
public static IFirebaseAdminRef EqualTo(this IFirebaseAdminRef firebaseRef, int value) { firebaseRef.Add(EqualToValue, value.ToString()); return(firebaseRef); }
public static async Task DeleteAsync(this IFirebaseAdminRef firebaseRef) => await firebaseRef.HttpClient.DeleteFromPathAsync(firebaseRef.Path);
public static void Delete(this IFirebaseAdminRef firebaseRef) => DeleteAsync(firebaseRef).Wait();
public static T Get <T>(this IFirebaseAdminRef firebaseRef) { return(GetAsync <T>(firebaseRef).Result); }