Skip to content

Commit 5c054c1

Browse files
author
Bart Koelman
authored
Fixed spelling errors (#663)
1 parent 2b64e03 commit 5c054c1

File tree

62 files changed

+199
-199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+199
-199
lines changed

src/Examples/GettingStarted/ResourceDefinitionExample/Model.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ namespace GettingStarted.ResourceDefinitionExample
55
public class Model : Identifiable
66
{
77
[Attr]
8-
public string DontExpose { get; set; }
8+
public string DoNotExpose { get; set; }
99
}
10-
}
10+
}

src/Examples/GettingStarted/ResourceDefinitionExample/ModelDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public ModelDefinition(IResourceGraph resourceGraph) : base(resourceGraph)
1313
// this might be used if the incoming value gets hashed or
1414
// encrypted prior to being persisted and this value should
1515
// never be sent back to the client
16-
HideFields(model => model.DontExpose);
16+
HideFields(model => model.DoNotExpose);
1717
}
1818
}
1919
}

src/Examples/GettingStarted/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void ConfigureServices(IServiceCollection services)
2222

2323
public void Configure(IApplicationBuilder app, SampleDbContext context)
2424
{
25-
context.Database.EnsureDeleted(); // indicies need to be reset
25+
context.Database.EnsureDeleted(); // indices need to be reset
2626
app.UseJsonApi();
2727
}
2828
}

src/JsonApiDotNetCore/Configuration/DefaultAttributeResponseBehavior.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
namespace JsonApiDotNetCore.Configuration
1+
namespace JsonApiDotNetCore.Configuration
22
{
33
/// <summary>
4-
/// Allows default valued attributes to be ommitted from the response payload
4+
/// Allows default valued attributes to be omitted from the response payload
55
/// </summary>
66
public struct DefaultAttributeResponseBehavior
77
{
88

99
/// <param name="omitNullValuedAttributes">Do not serialize default value attributes</param>
1010
/// <param name="allowClientOverride">
11-
/// Allow clients to override the serialization behavior through a query parmeter.
11+
/// Allow clients to override the serialization behavior through a query parameter.
1212
/// <example>
1313
/// ```
1414
/// GET /articles?omitDefaultValuedAttributes=true

src/JsonApiDotNetCore/Configuration/ILinksConfiguration.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using JsonApiDotNetCore.Models.Links;
1+
using JsonApiDotNetCore.Models.Links;
22

33
namespace JsonApiDotNetCore.Configuration
44
{
@@ -33,20 +33,20 @@ public interface ILinksConfiguration
3333
/// <summary>
3434
/// Configures globally which links to show in the <see cref="TopLevelLinks"/>
3535
/// object for a requested resource. Setting can be overriden per resource by
36-
/// adding a <see cref="LinksAttribute"/> to the class definitio of that resource.
36+
/// adding a <see cref="LinksAttribute"/> to the class definition of that resource.
3737
/// </summary>
3838
Link TopLevelLinks { get; }
3939

4040
/// <summary>
4141
/// Configures globally which links to show in the <see cref="ResourceLinks"/>
4242
/// object for a requested resource. Setting can be overriden per resource by
43-
/// adding a <see cref="LinksAttribute"/> to the class definitio of that resource.
43+
/// adding a <see cref="LinksAttribute"/> to the class definition of that resource.
4444
/// </summary>
4545
Link ResourceLinks { get; }
4646
/// <summary>
4747
/// Configures globally which links to show in the <see cref="RelationshipLinks"/>
4848
/// object for a requested resource. Setting can be overriden per resource by
49-
/// adding a <see cref="LinksAttribute"/> to the class definitio of that resource.
49+
/// adding a <see cref="LinksAttribute"/> to the class definition of that resource.
5050
/// Option can also be specified per relationship by using the associated links argument
5151
/// in the constructor of <see cref="RelationshipAttribute"/>.
5252
/// </summary>
@@ -68,4 +68,4 @@ public interface ILinksConfiguration
6868
Link RelationshipLinks { get; }
6969

7070
}
71-
}
71+
}

src/JsonApiDotNetCore/Configuration/JsonApiOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public class JsonApiOptions : IJsonApiOptions
8383
/// <summary>
8484
/// Whether or not clients can provide ids when creating resources.
8585
/// Defaults to false. When disabled the application will respond
86-
/// with a 403 Forbidden respponse if a client attempts to create a
86+
/// with a 403 Forbidden response if a client attempts to create a
8787
/// resource with a defined id.
8888
/// </summary>
8989
/// <example>

src/JsonApiDotNetCore/Configuration/NullAttributeResponseBehavior.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
namespace JsonApiDotNetCore.Configuration
22
{
33
/// <summary>
4-
/// Allows null attributes to be ommitted from the response payload
4+
/// Allows null attributes to be omitted from the response payload
55
/// </summary>
66
public struct NullAttributeResponseBehavior
77
{
88
/// <param name="omitNullValuedAttributes">Do not serialize null attributes</param>
99
/// <param name="allowClientOverride">
10-
/// Allow clients to override the serialization behavior through a query parmeter.
10+
/// Allow clients to override the serialization behavior through a query parameter.
1111
/// <example>
1212
/// ```
1313
/// GET /articles?omitNullValuedAttributes=true

src/JsonApiDotNetCore/Data/DefaultResourceRepository.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private bool IsHasOneRelationship(string internalRelationshipName, Type type)
147147
return false;
148148
}
149149
// relationshipAttr is null when we don't put a [RelationshipAttribute] on the inverse navigation property.
150-
// In this case we use relfection to figure out what kind of relationship is pointing back.
150+
// In this case we use reflection to figure out what kind of relationship is pointing back.
151151
return !type.GetProperty(internalRelationshipName).PropertyType.Inherits(typeof(IEnumerable));
152152
}
153153

@@ -359,12 +359,12 @@ public async Task<IReadOnlyList<TResource>> ToListAsync(IQueryable<TResource> en
359359

360360
/// <summary>
361361
/// Before assigning new relationship values (UpdateAsync), we need to
362-
/// attach the current database values of the relationship to the dbcontext, else
362+
/// attach the current database values of the relationship to the dbContext, else
363363
/// it will not perform a complete-replace which is required for
364364
/// one-to-many and many-to-many.
365365
/// <para />
366-
/// For example: a person `p1` has 2 todoitems: `t1` and `t2`.
367-
/// If we want to update this todoitem set to `t3` and `t4`, simply assigning
366+
/// For example: a person `p1` has 2 todo-items: `t1` and `t2`.
367+
/// If we want to update this todo-item set to `t3` and `t4`, simply assigning
368368
/// `p1.todoItems = [t3, t4]` will result in EF Core adding them to the set,
369369
/// resulting in `[t1 ... t4]`. Instead, we should first include `[t1, t2]`,
370370
/// after which the reassignment `p1.todoItems = [t3, t4]` will actually
@@ -383,7 +383,7 @@ protected void LoadCurrentRelationships(TResource oldEntity, RelationshipAttribu
383383
}
384384

385385
/// <summary>
386-
/// Given a iidentifiable relationshipvalue, verify if an entity of the underlying
386+
/// Given a IIdentifiable relationship value, verify if an entity of the underlying
387387
/// type with the same ID is already attached to the dbContext, and if so, return it.
388388
/// If not, attach the relationship value to the dbContext.
389389
///

src/JsonApiDotNetCore/Extensions/IServiceCollectionExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static IServiceCollection AddResourceService<T>(this IServiceCollection s
7676
{
7777
foreach (var openGenericType in ServiceDiscoveryFacade.ServiceInterfaces)
7878
{
79-
// A shorthand interface is one where the id type is ommitted
79+
// A shorthand interface is one where the id type is omitted
8080
// e.g. IResourceService<T> is the shorthand for IResourceService<T, TId>
8181
var isShorthandInterface = (openGenericType.GetTypeInfo().GenericTypeParameters.Length == 1);
8282
if (isShorthandInterface && resourceDescriptor.IdType != typeof(int))
@@ -102,7 +102,7 @@ public static IServiceCollection AddResourceService<T>(this IServiceCollection s
102102

103103
private static HashSet<ResourceDescriptor> GetResourceTypesFromServiceImplementation(Type type)
104104
{
105-
var resourceDecriptors = new HashSet<ResourceDescriptor>();
105+
var resourceDescriptors = new HashSet<ResourceDescriptor>();
106106
var interfaces = type.GetInterfaces();
107107
foreach (var i in interfaces)
108108
{
@@ -111,11 +111,11 @@ private static HashSet<ResourceDescriptor> GetResourceTypesFromServiceImplementa
111111
var firstGenericArgument = i.GenericTypeArguments.FirstOrDefault();
112112
if (TypeLocator.TryGetResourceDescriptor(firstGenericArgument, out var resourceDescriptor) == true)
113113
{
114-
resourceDecriptors.Add(resourceDescriptor);
114+
resourceDescriptors.Add(resourceDescriptor);
115115
}
116116
}
117117
}
118-
return resourceDecriptors;
118+
return resourceDescriptors;
119119
}
120120
}
121121
}

src/JsonApiDotNetCore/Formatters/JsonApiWriter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace JsonApiDotNetCore.Formatters
1313
/// <summary>
1414
/// Formats the response data used https://docs.microsoft.com/en-us/aspnet/core/web-api/advanced/formatting?view=aspnetcore-3.0.
1515
/// It was intended to have as little dependencies as possible in formatting layer for greater extensibility.
16-
/// It onls depends on <see cref="IJsonApiSerializer"/>.
16+
/// It only depends on <see cref="IJsonApiSerializer"/>.
1717
/// </summary>
1818
public class JsonApiWriter : IJsonApiWriter
1919
{
@@ -57,7 +57,7 @@ public async Task WriteAsync(OutputFormatterWriteContext context)
5757
}
5858
catch (Exception e)
5959
{
60-
_logger?.LogError(new EventId(), e, "An error ocurred while formatting the response");
60+
_logger?.LogError(new EventId(), e, "An error occurred while formatting the response");
6161
var errors = new ErrorCollection();
6262
errors.Add(new Error(500, e.Message, ErrorMeta.FromException(e)));
6363
responseContent = _serializer.Serialize(errors);

src/JsonApiDotNetCore/Graph/ResourceNameFormatters/IResourceNameFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public interface IResourceNameFormatter
1919
string FormatPropertyName(PropertyInfo property);
2020

2121
/// <summary>
22-
/// Aoplies the desired casing convention to the internal string.
22+
/// Applies the desired casing convention to the internal string.
2323
/// This is generally applied to the type name after pluralization.
2424
/// </summary>
2525
string ApplyCasingConvention(string properName);

src/JsonApiDotNetCore/Graph/ResourceNameFormatters/ResourceNameFormatterBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Reflection;
33
using Humanizer;
44
using JsonApiDotNetCore.Models;
@@ -28,7 +28,7 @@ public string FormatResourceName(Type type)
2828
}
2929

3030
/// <summary>
31-
/// Aoplies the desired casing convention to the internal string.
31+
/// Applies the desired casing convention to the internal string.
3232
/// This is generally applied to the type name after pluralization.
3333
/// </summary>
3434
public abstract string ApplyCasingConvention(string properName);

src/JsonApiDotNetCore/Graph/ServiceDiscoveryFacade.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public ServiceDiscoveryFacade AddAssembly(Assembly assembly)
6868
{
6969
AddDbContextResolvers(assembly);
7070

71-
var resourceDescriptors = TypeLocator.GetIdentifableTypes(assembly);
71+
var resourceDescriptors = TypeLocator.GetIdentifiableTypes(assembly);
7272
foreach (var resourceDescriptor in resourceDescriptors)
7373
{
7474
AddResource(assembly, resourceDescriptor);
@@ -109,7 +109,7 @@ private void AddDbContextResolvers(Assembly assembly)
109109
/// <param name="assembly">The assembly to search for resources in.</param>
110110
public ServiceDiscoveryFacade AddResources(Assembly assembly)
111111
{
112-
var identifiables = TypeLocator.GetIdentifableTypes(assembly);
112+
var identifiables = TypeLocator.GetIdentifiableTypes(assembly);
113113
foreach (var identifiable in identifiables)
114114
AddResource(assembly, identifiable);
115115

@@ -149,7 +149,7 @@ private void AddResourceToGraph(ResourceDescriptor identifiable)
149149
/// <param name="assembly">The assembly to search for resources in.</param>
150150
public ServiceDiscoveryFacade AddServices(Assembly assembly)
151151
{
152-
var resourceDescriptors = TypeLocator.GetIdentifableTypes(assembly);
152+
var resourceDescriptors = TypeLocator.GetIdentifiableTypes(assembly);
153153
foreach (var resourceDescriptor in resourceDescriptors)
154154
{
155155
AddServices(assembly, resourceDescriptor);
@@ -171,7 +171,7 @@ private void AddServices(Assembly assembly, ResourceDescriptor resourceDescripto
171171
/// <param name="assembly">The assembly to search for resources in.</param>
172172
public ServiceDiscoveryFacade AddRepositories(Assembly assembly)
173173
{
174-
var resourceDescriptors = TypeLocator.GetIdentifableTypes(assembly);
174+
var resourceDescriptors = TypeLocator.GetIdentifiableTypes(assembly);
175175
foreach (var resourceDescriptor in resourceDescriptors)
176176
{
177177
AddRepositories(assembly, resourceDescriptor);

src/JsonApiDotNetCore/Graph/TypeLocator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public static Type GetIdType(Type resourceType)
2929
/// <summary>
3030
/// Get all implementations of <see cref="IIdentifiable"/> in the assembly
3131
/// </summary>
32-
public static IEnumerable<ResourceDescriptor> GetIdentifableTypes(Assembly assembly)
32+
public static IEnumerable<ResourceDescriptor> GetIdentifiableTypes(Assembly assembly)
3333
=> (_identifiableTypeCache.TryGetValue(assembly, out var descriptors) == false)
34-
? FindIdentifableTypes(assembly)
34+
? FindIdentifiableTypes(assembly)
3535
: _identifiableTypeCache[assembly];
3636

37-
private static IEnumerable<ResourceDescriptor> FindIdentifableTypes(Assembly assembly)
37+
private static IEnumerable<ResourceDescriptor> FindIdentifiableTypes(Assembly assembly)
3838
{
3939
var descriptors = new List<ResourceDescriptor>();
4040
_identifiableTypeCache[assembly] = descriptors;
@@ -107,7 +107,7 @@ public static (Type implementation, Type registrationInterface) GetGenericInterf
107107
}
108108

109109
/// <summary>
110-
/// Get all derivitives of the concrete, generic type.
110+
/// Get all derivatives of the concrete, generic type.
111111
/// </summary>
112112
/// <param name="assembly">The assembly to search</param>
113113
/// <param name="openGenericType">The open generic type, e.g. `typeof(ResourceDefinition&lt;&gt;)`</param>
@@ -124,7 +124,7 @@ public static IEnumerable<Type> GetDerivedGenericTypes(Assembly assembly, Type o
124124
}
125125

126126
/// <summary>
127-
/// Get all derivitives of the specified type.
127+
/// Get all derivatives of the specified type.
128128
/// </summary>
129129
/// <param name="assembly">The assembly to search</param>
130130
/// <param name="openGenericType">The inherited type</param>

src/JsonApiDotNetCore/Hooks/Execution/HookExecutorHelper.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ public IEnumerable LoadDbValues(LeftType entityTypeForRepository, IEnumerable en
8080
var parameterizedGetWhere = GetType()
8181
.GetMethod(nameof(GetWhereAndInclude), BindingFlags.NonPublic | BindingFlags.Instance)
8282
.MakeGenericMethod(entityTypeForRepository, idType);
83-
var casted = ((IEnumerable<object>)entities).Cast<IIdentifiable>();
84-
var ids = casted.Select(e => e.StringId).Cast(idType);
83+
var cast = ((IEnumerable<object>)entities).Cast<IIdentifiable>();
84+
var ids = cast.Select(e => e.StringId).Cast(idType);
8585
var values = (IEnumerable)parameterizedGetWhere.Invoke(this, new object[] { ids, relationshipsToNextLayer });
8686
if (values == null) return null;
8787
return (IEnumerable)Activator.CreateInstance(typeof(HashSet<>).MakeGenericType(entityTypeForRepository), values.Cast(entityTypeForRepository));
@@ -155,7 +155,7 @@ public Dictionary<RelationshipAttribute, IEnumerable> LoadImplicitlyAffected(
155155
{
156156
if (IsHasManyThrough(kvp, out var lefts, out var relationship)) continue;
157157

158-
// note that we dont't have to check if BeforeImplicitUpdate hook is implemented. If not, it wont ever get here.
158+
// note that we don't have to check if BeforeImplicitUpdate hook is implemented. If not, it wont ever get here.
159159
var includedLefts = LoadDbValues(relationship.LeftType, lefts, ResourceHook.BeforeImplicitUpdateRelationship, relationship);
160160

161161
foreach (IIdentifiable ip in includedLefts)
@@ -171,17 +171,17 @@ public Dictionary<RelationshipAttribute, IEnumerable> LoadImplicitlyAffected(
171171
{
172172
dbRightEntityList = (IList)relationshipValue;
173173
}
174-
var dbRightEntityListCasted = dbRightEntityList.Cast<IIdentifiable>().ToList();
175-
if (existingRightEntities != null) dbRightEntityListCasted = dbRightEntityListCasted.Except(existingRightEntities.Cast<IIdentifiable>(), _comparer).ToList();
174+
var dbRightEntityListCast = dbRightEntityList.Cast<IIdentifiable>().ToList();
175+
if (existingRightEntities != null) dbRightEntityListCast = dbRightEntityListCast.Except(existingRightEntities.Cast<IIdentifiable>(), _comparer).ToList();
176176

177-
if (dbRightEntityListCasted.Any())
177+
if (dbRightEntityListCast.Any())
178178
{
179179
if (!implicitlyAffected.TryGetValue(relationship, out IEnumerable affected))
180180
{
181181
affected = TypeHelper.CreateListFor(relationship.RightType);
182182
implicitlyAffected[relationship] = affected;
183183
}
184-
((IList)affected).AddRange(dbRightEntityListCasted);
184+
((IList)affected).AddRange(dbRightEntityListCast);
185185
}
186186
}
187187
}

src/JsonApiDotNetCore/Hooks/Execution/IHookExecutorHelper.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections;
33
using System.Collections.Generic;
44
using JsonApiDotNetCore.Models;
@@ -9,7 +9,7 @@ namespace JsonApiDotNetCore.Hooks
99
/// A helper class for retrieving meta data about hooks,
1010
/// fetching database values and performing other recurring internal operations.
1111
///
12-
/// Used internalyl by <see cref="ResourceHookExecutor"/>
12+
/// Used internally by <see cref="ResourceHookExecutor"/>
1313
/// </summary>
1414
internal interface IHookExecutorHelper
1515
{
@@ -49,13 +49,13 @@ internal interface IHookExecutorHelper
4949
IEnumerable LoadDbValues(Type repositoryEntityType, IEnumerable entities, ResourceHook hook, params RelationshipAttribute[] relationships);
5050

5151
/// <summary>
52-
/// Checks if the display database values option is allowed for the targetd hook, and for
52+
/// Checks if the display database values option is allowed for the targeted hook, and for
5353
/// a given resource of type <paramref name="entityType"/> checks if this hook is implemented and if the
5454
/// database values option is enabled.
5555
/// </summary>
56-
/// <returns><c>true</c>, if load db values was shoulded, <c>false</c> otherwise.</returns>
56+
/// <returns><c>true</c>, if should load db values, <c>false</c> otherwise.</returns>
5757
/// <param name="entityType">Container entity type.</param>
5858
/// <param name="hook">Hook.</param>
5959
bool ShouldLoadDbValues(Type entityType, ResourceHook hook);
6060
}
61-
}
61+
}

0 commit comments

Comments
 (0)