Blazor Inline Editing

Hello,
First of all, thank you for having such a great tool available to all developers, we certainly appreciate it!

How do I get the type of operation being performed when I hit the "Save" button in the Component?

> <EditTemplate Context="order">
>       <RadzenButton Icon="save" Size="ButtonSize.Small" Click="@((args) => 
>                                                SaveRow(order))">
>       </RadzenButton>
>       <RadzenButton Icon="cancel" Size="ButtonSize.Small" 
>                   ButtonStyle="ButtonStyle.Secondary" Click="@((args) => CancelEdit(order))">
>       </RadzenButton>
> </EditTemplate>

For instance, how do I make that determination here, whether is an Insert, Update or Delete?
void SaveRow(Order order)
{
ordersGrid.UpdateRow(order);
}

Thank you in advance.

You can check the entity state: var orderEntry = dbContext.Entry(order);. For example orderEntry.State == EntityState.Modified is when you modify exiting item (update).

Awesome!
Thank you for the solution and keep up the great work!

I got another question, please.
When creating another row using the method you have on your example:

void OnCreateRow(Order order)
{
dbContext.Add(order);

    // For demo purposes only
    order.Customer = dbContext.Customers.Find(order.CustomerID);
    order.Employee = dbContext.Employees.Find(order.EmployeeID);

    // For production
    //dbContext.SaveChanges();
}

Is there anything else I should be doing? It adds the record. However, it stays in Edit mode and never refresh the grid. I tried using the Reload() but that did not work either.

Never mind. I was trying to call the method twice as the "RowCreate" was already declared in the datagrid itself. My oversight.