Skip to content

DefaultEntityRepository cleanup #518

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

Merged
merged 30 commits into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5f3e04b
refactor: AttachHasOnePointers
maurei Jun 7, 2019
e8d1096
refactor: AssignHasMany pointers
maurei Jun 7, 2019
1420d6d
refactor assign relationships and applied to updateasync method
maurei Jun 7, 2019
24dd97c
refactor: tests passing again
maurei Jun 7, 2019
0304725
test: add implicit removal test
maurei Jun 7, 2019
f60587f
test: all passing
maurei Jun 7, 2019
4cd9465
chore: addedd notes wrt implicit remove
maurei Jun 7, 2019
d1f39e6
comments: added comment to assign method
maurei Jun 7, 2019
bcbf8c3
Merge branch 'master' into fix/reattachment
maurei Jun 7, 2019
7df5233
fix: support for entity resource split
maurei Jun 7, 2019
0296eb4
fix: minor refactor, comments
maurei Jun 8, 2019
f0d5924
fix: foreignkey set null bug
maurei Jun 8, 2019
9f7550c
feat: decoupled repository from JsonApiContext with respect to updati…
maurei Jun 11, 2019
7aea60c
feat: decoupled IJsonApiContext from repository wrt updating resources
maurei Jun 11, 2019
652d65f
fix: resource separation issue|
maurei Jun 11, 2019
9838627
chore: cherry picked inverse relationships from hooks branch
maurei Jun 11, 2019
fbe69fc
fix: tests
maurei Jun 11, 2019
35a2f54
feat: implicit remove support
maurei Jun 11, 2019
6e6f7fa
fix: test
maurei Jun 11, 2019
c1d472d
fix: bugs with inverse relationship loading
maurei Jun 11, 2019
f45972f
tests: implicit remove through create tests
maurei Jun 11, 2019
d8b4217
feat: mark obsolete UpdateAsync(TId id, TEntity entity) method, add n…
maurei Jun 11, 2019
30765c3
fix: #520
maurei Jun 11, 2019
9139852
fix: separation tests
maurei Jun 11, 2019
457e93d
chore: comments
maurei Jun 12, 2019
65f8a3a
Update DefaultEntityRepository.cs
maurei Jun 12, 2019
3ddb6a2
Update DefaultEntityRepository.cs
maurei Jun 17, 2019
2437077
Update TypeExtensions.cs
maurei Jun 17, 2019
415306e
Update DefaultEntityRepository.cs
maurei Jun 17, 2019
52a452d
Update JsonApiReader.cs
maurei Jun 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ public DefaultEntityRepository(
_resourceDefinition = resourceDefinition;
}

public
DefaultEntityRepository(
public DefaultEntityRepository(
ILoggerFactory loggerFactory,
IJsonApiContext jsonApiContext,
IDbContextResolver contextResolver,
Expand Down Expand Up @@ -172,8 +171,8 @@ public virtual async Task<TEntity> CreateAsync(TEntity entity)
/// <summary>
/// Loads the inverse relationships to prevent foreign key constraints from being violated
/// to support implicit removes, see https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/502.
///
/// example:
/// <para/>
/// Consider the following example:
/// person.todoItems = [t1,t2] is updated to [t3, t4]. If t3, and/or t4 was
/// already related to a other person, and these persons are NOT loaded in to the
/// db context, then the query may cause a foreign key constraint. Loading
Expand Down
3 changes: 3 additions & 0 deletions src/JsonApiDotNetCore/Extensions/TypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ namespace JsonApiDotNetCore.Extensions
{
internal static class TypeExtensions
{
/// <summary>
/// Extension to use the LINQ AddRange method on an IList
/// </summary>
public static void AddRange<T>(this IList list, IEnumerable<T> items)
{
if (list == null) throw new ArgumentNullException(nameof(list));
Expand Down