I'm in the middle of creating a desktop application that allows a user to insert their Organisation details into a database that uses Entity Framework.
So far, I've created CRUD operations to allow the user to add, delete and update data, which was straight forward.
When doing this, I'm using commands, as I am trying to use the MVVM design pattern.
But what I want to achieve is to allow the user to only enter one row of data into the database, so what would be the best way to achieve it?
I've looked at using a Flag as well as using a query. Here is the code I have currently;
private ICommand showAddCommand;
public ICommand ShowAddCommand
if (this.showAddCommand == null)
this.showAddCommand = new RelayCommand(this.SaveFormExecute, this.SaveFormCanExecute);
private bool SaveFormCanExecute()
private void SaveFormExecute()
so what would be the best way to do this? Any help will be appreciated.