protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it RegEntity regEntity = new RegEntity(); regEntity.Name = "xyz"; regEntity.Password = "******"; regEntity.Username = "******"; //save obj in local db MainVm.SaveEmployeeInDB(regEntity, MainApplication.Database); Button button = FindViewById <Button>(Resource.Id.myButton); // RegEntity objw = MainVm.GetEmp("snehjadhav", MainApplication.Database); button.Click += delegate { button.Text = $"{count++} clicks!"; }; }
public int SaveItem(RegEntity item) { lock (locker) { if (item.ID != 0) { //Update Item database.Update(item); return(item.ID); } else { //Insert item return(database.Insert(item)); } } }
public void Update(RegEntity entity) { _context.Entry(entity).State = EntityState.Modified; }
public void Remove(RegEntity entity) { _context.Remove(entity); }
public async void AddAsync(RegEntity entity) { await _context.RegRecords.AddAsync(entity); }