Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
541 B
9
Indexable
Never
//Delete function


try
{
    var getschoolkey = (await client
        .Child($"StudentAccount/{key}/Schools")
        .OnceAsync<Schools>()).FirstOrDefault
        (a => a.Object.SchoolID == schid);
    if (getschoolkey != null)
    {
        await client
            .Child($"StudentAccount/{key}/Schools")
        .Child(getschoolkey.Key)
            .DeleteAsync();
        client.Dispose();
        return true;
    }

    client.Dispose();
    return false;
}
catch
{
    client.Dispose();
    return false;
}
Leave a Comment