public void SaveModal() { if (this.Model.Id.HasValue) { var command = DomainServices.Convert <UpdateIngredientCommand>(Model); DomainServices.RunCommand(command); } else { var command = DomainServices.Convert <CreateIngredientCommand>(Model); DomainServices.RunCommand(command); } LoadIngredientsList(); Model = new IngredientViewModel(); ModalService.Hide(); }