Skip to content

Instantly share code, notes, and snippets.

@marcominerva
Created February 13, 2026 09:50
Show Gist options
  • Select an option

  • Save marcominerva/cdcebc4eeff35e1a0690085b0fc0437e to your computer and use it in GitHub Desktop.

Select an option

Save marcominerva/cdcebc4eeff35e1a0690085b0fc0437e to your computer and use it in GitHub Desktop.
public interface IDataContext
{
ValueTask<T?> GetObjectAsync<T>(int id) where T : class;
IQueryable<T> GetData<T>(bool trackingChanges = false, bool ignoreQueryFilters = false) where T : class;
IQueryable<T> GetData<T>(string sql, params object?[] arguments) where T : class;
IQueryable<T> GetDataFromStoredProcedure<T>(string command, params object?[] arguments) where T : class;
Task ExecuteStoredProcedureAsync(string command, params object?[] arguments);
void Insert<T>(T entity) where T : class;
void Update<T>(T entity) where T : class;
void Delete<T>(T entity) where T : class;
void Delete<T>(IEnumerable<T> entities) where T : class;
Task<int> SaveAsync();
Task ExecuteTransactionAsync(Func<Task> action);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment