i'm working on new app and i trying to call a FireBase from class

i have a new Xamarin.Form C# 2019 and the class in folder insaide a project enter image description here

this is the button when i click

public async void BtnAdd_Clicked(object sender, EventArgs e)
        await DbFirebase.AddPerson(Fname.Text,Phone.Text,Email.Text,Password.Text);
        Fname.Text = string.Empty;
        Phone.Text = string.Empty;
        Email.Text = string.Empty;
        Password.Text = string.Empty;
        await DisplayAlert("Success", "Person Added Successfully", "OK");
        var allPersons = await Data.DbFirebase.GetAllPersons();
        lstPersons.ItemsSource = allPersons;

//and this is the class(DbFirebase.cs) that i call insaide Folder (Data) in the project Data

public async Task AddPerson(string FName, string Phone,string Email, string Password)
        await client
          .PostAsync(new Users()
          { FName = FName,
              Phone = Phone,
              Email =Email,
              Password = Password

enter image description here

i receive error cs0120 (an object reference is required for the non-static field xamarin)

0 Answers