public static void UpdateUserInfo(DennaUser usr, DennaUser newUser) { RealmContext.GetInstance().Write(() => { usr.Email = newUser.Email; usr.FullName = newUser.FullName; RealmContext.GetInstance().Add(usr, update: true); }); }
protected override void OnNavigatedTo(NavigationEventArgs e) { Username.Text = UserService.GetUsername(); var userInfo = UserService.GetUserInfo(); FullName.Text = userInfo.FullName; Email.Text = userInfo.Email; Ses.Text = RealmContext.GetInstance().GetSession().State.ToString(); base.OnNavigatedTo(e); }
public static void CreateUserInformation(string name, string email) { var usr = new DennaUser() { FullName = name, Email = email }; RealmContext.GetInstance().Write(() => { RealmContext.GetInstance().Add(usr); }); }
public void CreateUserInformation(string name, string email, string username) { var instance = RealmContext.GetInstance(); var usr = new DennaUser() { FullName = name, Email = email, Username = username }; instance.Write(() => { instance.Add(usr); }); }
protected override void OnNavigatedTo(NavigationEventArgs e) { try { Username.Text = _usrsvc.GetUsername(); var userInfo = _usrsvc.GetUserInfo(); FullName.Text = userInfo.FullName; Email.Text = userInfo.Email; } catch { "Something isn't right".ShowMessage("Let us fetch your data from our cloud ..."); } Ses.Text = RealmContext.GetInstance().GetSession().State.ToString(); base.OnNavigatedTo(e); }
public void UpdateUserInfo(DennaUser usr, DennaUser newUser) { if (usr.Email != newUser.Email || usr.FullName != newUser.FullName) { try { var instance = RealmContext.GetInstance(); instance.Write(() => { usr.Email = newUser.Email; usr.FullName = newUser.FullName; instance.Add(usr, update: true); }); } catch (Exception e) { "Error".ShowMessage(e.Message); } } }
public DogService() { _instance = RealmContext.GetInstance(); repo = new GenericRepository <Dog>(_instance); r = new Random(); }
public DennaUser GetUserInfo() { var instance = RealmContext.GetInstance(); return(instance.All <DennaUser>().FirstOrDefault()); }
public TodoService() { _instance = RealmContext.GetInstance(); repo = new GenericRepository <Todo>(_instance); }
public static DennaUser GetUserInfo() => RealmContext.GetInstance().All <DennaUser>().FirstOrDefault();