I want to refresh my database in form application but I don't know how can I. I found some code but I am not sure is it work for getting recent datas and Where should I write it.
I tried Refresh or update my datagridview but it didn't work.
public static void ReloadEntity<TEntity>(
this DbContext context,
TEntity entity)
where TEntity : class
{
context.Entry(entity).Reload();
}