The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Eduardo Gomez 3,426 Reputation points
2021-10-11T20:31:08.647+00:00

I am trying to insert data into a SQL Azure database but is telling me that the service is not available

  [AddINotifyPropertyChangedInterface]  
    public class Users {  
  
        public string Id { get; set; }  
  
        [OnChangedMethod(nameof(OnPropertyChanged))]  
        public string Email { get; set; }  
  
        [OnChangedMethod(nameof(OnPropertyChanged))]  
        public string Password { get; set; }  
  
        [JsonIgnore]  
        public Action OnAnyPropertiesChanged { get; set; }  
        private void OnPropertyChanged() {  
            OnAnyPropertiesChanged?.Invoke();  
        }  

  [AddINotifyPropertyChangedInterface]  
    public class LoginPageViewModel {  
  
        public ICommand OpenRegisterPopupCommand { get; set; }  
  
        public ICommand Register { get; set; }  
  
        public ICommand Login { get; set; }  
  
        public Users Users { get; set; }  
  
        public bool IsRegisterAllowed { get; set; }  
  
        public bool IsPopUpOpen { get; set; }  
  
  
  
        public LoginPageViewModel() {  
  
            Users = new Users {  
                OnAnyPropertiesChanged = () => {  
  
                    (Login as Command).ChangeCanExecute();  
                    (Register as Command).ChangeCanExecute();  
  
                }  
            };  
  
            Login = new Command(LoginAction, CanPreformAction);  
  
            Register = new Command(RegisterAction, CanPreformAction);  
  
            OpenRegisterPopupCommand = new Command(() => {  
                IsPopUpOpen = true;  
            });  
        }  
  
        private bool CanPreformAction(object arg) {  
  
            return Users != null && !string.IsNullOrEmpty(Users.Email) && !string.IsNullOrEmpty(Users.Password);  
  
        }  
  
        private async void RegisterAction(object obj) {  
              
            //Inserting, but the service is not available  
            await App.client.GetTable<Users>().InsertAsync(Users);   
  
        }  

I do not have an ASP client, because I did everything in the portal, and I am trying to change my backend from firebase to 139410-screenshot-2021-10-11-020145.pngaszure

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,357 questions
Azure SQL Database
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.