Skip to content

Commit e4a4d9c

Browse files
committed
chore: remove bulk related tests
1 parent 54ff111 commit e4a4d9c

24 files changed

+4
-1263
lines changed

JsonApiDotnetCore.sln

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NoEntityFrameworkTests", "t
3535
EndProject
3636
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "test\UnitTests\UnitTests.csproj", "{8788FF65-C2B6-40B2-A3A0-1E3D91C02664}"
3737
EndProject
38-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OperationsExampleTests", "test\OperationsExampleTests\OperationsExampleTests.csproj", "{65BF5960-3D9B-4230-99F4-A12CAA130792}"
39-
EndProject
4038
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceEntitySeparationExampleTests", "test\ResourceEntitySeparationExampleTests\ResourceEntitySeparationExampleTests.csproj", "{778C4EB9-BD65-4C0F-9230-B5CB1D72186A}"
4139
EndProject
4240
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscoveryTests", "test\DiscoveryTests\DiscoveryTests.csproj", "{03032A2F-664D-4DD8-A82F-AD8A482EDD85}"
@@ -127,18 +125,6 @@ Global
127125
{8788FF65-C2B6-40B2-A3A0-1E3D91C02664}.Release|x64.Build.0 = Release|Any CPU
128126
{8788FF65-C2B6-40B2-A3A0-1E3D91C02664}.Release|x86.ActiveCfg = Release|Any CPU
129127
{8788FF65-C2B6-40B2-A3A0-1E3D91C02664}.Release|x86.Build.0 = Release|Any CPU
130-
{65BF5960-3D9B-4230-99F4-A12CAA130792}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
131-
{65BF5960-3D9B-4230-99F4-A12CAA130792}.Debug|Any CPU.Build.0 = Debug|Any CPU
132-
{65BF5960-3D9B-4230-99F4-A12CAA130792}.Debug|x64.ActiveCfg = Debug|Any CPU
133-
{65BF5960-3D9B-4230-99F4-A12CAA130792}.Debug|x64.Build.0 = Debug|Any CPU
134-
{65BF5960-3D9B-4230-99F4-A12CAA130792}.Debug|x86.ActiveCfg = Debug|Any CPU
135-
{65BF5960-3D9B-4230-99F4-A12CAA130792}.Debug|x86.Build.0 = Debug|Any CPU
136-
{65BF5960-3D9B-4230-99F4-A12CAA130792}.Release|Any CPU.ActiveCfg = Release|Any CPU
137-
{65BF5960-3D9B-4230-99F4-A12CAA130792}.Release|Any CPU.Build.0 = Release|Any CPU
138-
{65BF5960-3D9B-4230-99F4-A12CAA130792}.Release|x64.ActiveCfg = Release|Any CPU
139-
{65BF5960-3D9B-4230-99F4-A12CAA130792}.Release|x64.Build.0 = Release|Any CPU
140-
{65BF5960-3D9B-4230-99F4-A12CAA130792}.Release|x86.ActiveCfg = Release|Any CPU
141-
{65BF5960-3D9B-4230-99F4-A12CAA130792}.Release|x86.Build.0 = Release|Any CPU
142128
{778C4EB9-BD65-4C0F-9230-B5CB1D72186A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
143129
{778C4EB9-BD65-4C0F-9230-B5CB1D72186A}.Debug|Any CPU.Build.0 = Debug|Any CPU
144130
{778C4EB9-BD65-4C0F-9230-B5CB1D72186A}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -200,7 +186,6 @@ Global
200186
{CAF331F8-9255-4D72-A1A8-A54141E99F1E} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
201187
{4F15A8F8-5BC6-45A1-BC51-03F921B726A4} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
202188
{8788FF65-C2B6-40B2-A3A0-1E3D91C02664} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
203-
{65BF5960-3D9B-4230-99F4-A12CAA130792} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
204189
{778C4EB9-BD65-4C0F-9230-B5CB1D72186A} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
205190
{03032A2F-664D-4DD8-A82F-AD8A482EDD85} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
206191
{DF0FCFB2-CB12-44BA-BBB5-1BE0BCFCD14C} = {076E1AE4-FD25-4684-B826-CAAE37FEA0AA}

src/JsonApiDotNetCore/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Runtime.CompilerServices;
2-
[assembly: InternalsVisibleTo("OperationsExampleTests")]
32
[assembly:InternalsVisibleTo("UnitTests")]
43
[assembly:InternalsVisibleTo("JsonApiDotNetCoreExampleTests")]
54
[assembly:InternalsVisibleTo("NoEntityFrameworkTests")]

src/JsonApiDotNetCore/Configuration/IJsonApiOptions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public interface IJsonApiOptions : ILinksConfiguration, ISerializerOptions
2323
int DefaultPageSize { get; }
2424
bool ValidateModelState { get; }
2525
bool AllowClientGeneratedIds { get; }
26-
bool EnableOperations { get; set; }
2726
IResourceGraph ResourceGraph { get; set; }
2827
bool AllowCustomQueryParameters { get; set; }
2928
string Namespace { get; set; }

src/JsonApiDotNetCore/Extensions/IServiceCollectionExtensions.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,12 @@
1515
using JsonApiDotNetCore.Serialization;
1616
using JsonApiDotNetCore.Hooks;
1717
using JsonApiDotNetCore.Services;
18-
using JsonApiDotNetCore.Services.Operations;
19-
using JsonApiDotNetCore.Services.Operations.Processors;
2018
using Microsoft.AspNetCore.Http;
2119
using Microsoft.AspNetCore.Mvc;
2220
using Microsoft.EntityFrameworkCore;
2321
using Microsoft.Extensions.DependencyInjection;
2422
using JsonApiDotNetCore.Internal.Contracts;
2523
using JsonApiDotNetCore.Query;
26-
using JsonApiDotNetCore.Serialization.Deserializer;
27-
using JsonApiDotNetCore.Query;
2824
using JsonApiDotNetCore.Serialization.Server.Builders;
2925
using JsonApiDotNetCore.Serialization.Server;
3026
using JsonApiDotNetCore.Serialization.Client;
@@ -161,11 +157,6 @@ public static void AddJsonApiInternals(
161157
services.AddSingleton(new DbContextOptionsBuilder().Options);
162158
}
163159

164-
if (jsonApiOptions.EnableOperations)
165-
{
166-
AddOperationServices(services);
167-
}
168-
169160
services.AddScoped(typeof(IEntityRepository<>), typeof(DefaultEntityRepository<>));
170161
services.AddScoped(typeof(IEntityRepository<,>), typeof(DefaultEntityRepository<,>));
171162

src/JsonApiDotNetCore/Hooks/Execution/ResourcePipelineEnum.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ public enum ResourcePipeline
1414
Post,
1515
Patch,
1616
PatchRelationship,
17-
Delete,
18-
BulkPost,
19-
BulkPatch,
20-
BulkDelete
17+
Delete
2118
}
2219
}

src/JsonApiDotNetCore/Hooks/IResourceHookContainer.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ public interface IBeforeHooks<TResource> where TResource : class, IIdentifiable
2424
/// layer just before creation of entities of type <typeparamref name="TResource"/>.
2525
/// <para />
2626
/// For the <see cref="ResourcePipeline.Post"/> pipeline, <paramref name="entities"/>
27-
/// will typically contain one entry. For <see cref="ResourcePipeline.BulkCreate"/>,
28-
/// <paramref name="entities"/> can contain multiple entities.
27+
/// will typically contain one entry.
2928
/// <para />
3029
/// The returned <see cref="IEnumerable{TEntity}"/> may be a subset
3130
/// of <paramref name="entities"/>, in which case the operation of the
@@ -55,8 +54,6 @@ public interface IBeforeHooks<TResource> where TResource : class, IIdentifiable
5554
/// <para />
5655
/// For the <see cref="ResourcePipeline.Patch"/> pipeline, the
5756
/// <paramref name="entities" /> will typically contain one entity.
58-
/// For <see cref="ResourcePipeline.BulkPatch"/>, this it may contain
59-
/// multiple entities.
6057
/// <para />
6158
/// The returned <see cref="IEnumerable{TEntity}"/> may be a subset
6259
/// of the <see cref="DiffableEntityHashSet{TEntity}"/> property in parameter <paramref name="entities"/>,
@@ -65,7 +62,7 @@ public interface IBeforeHooks<TResource> where TResource : class, IIdentifiable
6562
/// changes of the properties on the entities.
6663
/// <para />
6764
/// If new relationships are to be created with the to-be-updated entities,
68-
/// this will be reflected by the corresponding NavigationProperty being set.
65+
/// this will be reflected by the corresponding NavigationProperty beinƒg set.
6966
/// For each of these relationships, the <see cref="ResourceDefinition{T}.BeforeUpdateRelationship"/>
7067
/// hook is fired after the execution of this hook.
7168
/// <para />
@@ -85,8 +82,6 @@ public interface IBeforeHooks<TResource> where TResource : class, IIdentifiable
8582
/// <para />
8683
/// For the <see cref="ResourcePipeline.Delete"/> pipeline,
8784
/// <paramref name="entities" /> will typically contain one entity.
88-
/// For <see cref="ResourcePipeline.BulkDelete"/>, this it may contain
89-
/// multiple entities.
9085
/// <para />
9186
/// The returned <see cref="IEnumerable{TEntity}"/> may be a subset
9287
/// of <paramref name="entities"/>, in which case the operation of the

src/JsonApiDotNetCore/Middleware/RequestMiddleware.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,11 @@ public async Task Invoke(HttpContext httpContext,
3333

3434
if (IsValid())
3535
{
36-
_currentRequest.IsBulkRequest = PathIsBulk();
3736
_currentRequest.IsRelationshipPath = PathIsRelationship();
3837
await _next(httpContext);
3938
}
4039
}
4140

42-
private bool PathIsBulk()
43-
{
44-
var actionName = (string)_httpContext.GetRouteData().Values["action"];
45-
return actionName.ToLower().Contains("bulk");
46-
}
47-
4841
protected bool PathIsRelationship()
4942
{
5043
var actionName = (string)_httpContext.GetRouteData().Values["action"];

src/JsonApiDotNetCore/RequestServices/Contracts/ICurrentRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace JsonApiDotNetCore.Managers.Contracts
1212
/// This is the former RequestManager. TODO: not done.
1313
/// Metadata associated to the current json:api request.
1414
/// </summary>
15-
public interface ICurrentRequest : IQueryRequest
15+
public interface ICurrentRequest
1616
{
1717
/// <summary>
1818
/// The request namespace. This may be an absolute or relative path

src/JsonApiDotNetCore/RequestServices/CurrentRequest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class CurrentRequest : ICurrentRequest
2525

2626
public Dictionary<RelationshipAttribute, object> RelationshipsToUpdate { get; set; }
2727

28-
public bool IsBulkRequest { get; set; } = false;
2928
public RelationshipAttribute RequestRelationship { get; set; }
3029

3130
public List<string> GetFields()

test/OperationsExampleTests/.gitignore

Lines changed: 0 additions & 234 deletions
This file was deleted.

0 commit comments

Comments
 (0)