Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Force DataSourceLoader to load data before it is returned from a controller's action

Open
#347 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
api, backend

Research direction

Reproduce the shown controller action with a disposed MyDbContext and DataSourceLoader.Load(db.Table0, loadOptions), then inspect how the returned query is executed. Done means the action can dispose the context without an ObjectDisposedException while still returning the loaded data; add or update a regression test if the repository provides a suitable test location.

Written by the indexing model from the issue text.

Description

enhancement has-workaround
// GET
using (var db = new MyDbContext())
{
    return this.Request.CreateResponse(DataSourceLoader.Load(db.Table0, loadOptions));
}

This code throws ObjectDisposedException because the MyDbContext instance is disposed of before the inner query is executed.

Related:

Dominant language
C#
Stars
165
Forks
140
Avg merge
1d 2h
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DevExpress/DevExtreme.AspNet.Data

All issues in DevExpress/DevExtreme.AspNet.Data

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.