-
-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize Queries #404
Comments
Very good points! #221 was opened to address your first point and was implemented in #225. However, I closed the PR because I didn't have cycles at that time to complete it. From the PR:
In retrospect, based on experience with other projects (including DotnetTestAbstractions), I think tests should not share the same |
How about having Somewhat related, better naming could be nicer. Looking at |
I think your reference to GetRawAsync is actually the intent of Get. Get is not async. It doesn’t actually run a query since it returns IQueryable. It serves as the foundation for (most) other requests. |
Right, it could be called |
I'm open to discussion on the name change. For me, "GetRaw" doesn't actually clear the situation up any and begs additional questions. Perhaps just The rollout might look like: // 1st release
[Obsolete("Use GetRaw instead", error: false)]
IQueryable<TEntity> Get() => GetRaw(isReadOnly: false);
IQueryable<TEntity> GetRaw(bool isReadOnly = true);
// 2nd (major) release
[Obsolete("Use GetRaw instead", error: true)]
IQueryable<TEntity> Get() => GetRaw(isReadOnly: false);
IQueryable<TEntity> GetRaw(bool isReadOnly = true);
// 3rd (major) release
// gets removed in a major release so that someone jumping from 2.x -> 3.1
// will still get an informative error message
// jumping from 2.x -> 4.x will just break...
IQueryable<TEntity> GetRaw(bool isReadOnly = true); The only thing here is that it makes global configuration more difficult which is what is needed for some testing scenarios (e.g. in Another option that would address this is: IQueryable<TEntity> GetRaw(bool? isReadOnly = null); In the |
I like Since version 3 is beta, does it have to go through all those releases? |
I think it should. Because if we skip straight to the breaking change, then developers will upgrade to 3.0.0 with no prior warning and may have to change a significant amount of their code base (albeit find and replace should be pretty straightforward). I prefer to deprecate first when possible. Step 1 and 2 can probably be combined though. And step 3 should actually keep the Obsolete attribute and simply set error: true |
@maurei status on this? |
Closing this, because:
|
There are a few improvements that can be done to the auto generated endpoints:
.AsNoTracking()
added to the query.Attach()
->.Remove()
instead of.Get()
->.Remove()
to avoid making two callsThe text was updated successfully, but these errors were encountered: