Skip to content

Corrections in documentation after public API changes from #808 #823

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 1 commit into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/getting-started/step-by-step.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The easiest way to do this is to inherit from `Identifiable`
```c#
public class Person : Identifiable
{
[Attr("name")]
[Attr]
public string Name { get; set; }
}
```
Expand All @@ -61,7 +61,7 @@ public class AppDbContext : DbContext

### Define Controllers

You need to create controllers that inherit from `JsonApiController<T>` or `JsonApiController<T, TId>`
You need to create controllers that inherit from `JsonApiController<TResource>` or `JsonApiController<TResource, TId>`
where `T` is the model that inherits from `Identifiable<TId>`

```c#
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/extensibility/controllers.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Controllers

You need to create controllers that inherit from `JsonApiController<T>`
You need to create controllers that inherit from `JsonApiController<TResource>`

```c#
public class ArticlesController : JsonApiController<Article>
Expand Down
6 changes: 3 additions & 3 deletions docs/usage/extensibility/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public class TodoItemService : JsonApiResourceService<TodoItem>
IPaginationContext paginationContext,
IJsonApiOptions options,
ILoggerFactory loggerFactory,
ICurrentRequest currentRequest,
IJsonApiRequest request,
IResourceChangeTracker<TResource> resourceChangeTracker,
IResourceFactory resourceFactory,
IResourceHookExecutor hookExecutor = null)
: base(repository, queryLayerComposer, paginationContext, options, loggerFactory, currentRequest,
: base(repository, queryLayerComposer, paginationContext, options, loggerFactory, request,
resourceChangeTracker, resourceFactory, hookExecutor)
{
_notificationService = notificationService;
Expand All @@ -47,7 +47,7 @@ public class TodoItemService : JsonApiResourceService<TodoItem>
## Not Using Entity Framework Core?

As previously discussed, this library uses Entity Framework Core by default.
If you'd like to use another ORM that does not provide what JsonApiResourceService depends upon, you can use a custom `IResourceService<T>` implementation.
If you'd like to use another ORM that does not provide what JsonApiResourceService depends upon, you can use a custom `IResourceService<TResource>` implementation.

```c#
// Startup.cs
Expand Down
8 changes: 4 additions & 4 deletions docs/usage/resources/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ There are two ways the public attribute name is determined:
```c#
public class Person : Identifiable
{
[Attr("first-name")]
[Attr(PublicName = "first-name")]
public string FirstName { get; set; }
}
```
Expand All @@ -45,7 +45,7 @@ Attributes can be marked to allow returning their value in responses. When not a
```c#
public class User : Identifiable<int>
{
[Attr(~AttrCapabilities.AllowView)]
[Attr(Capabilities = ~AttrCapabilities.AllowView)]
public string Password { get; set; }
}
```
Expand All @@ -57,7 +57,7 @@ Attributes can be marked as mutable, which will allow `PATCH` requests to update
```c#
public class Person : Identifiable<int>
{
[Attr(AttrCapabilities.AllowMutate)]
[Attr(Capabilities = AttrCapabilities.AllowChange)]
public string FirstName { get; set; }
}
```
Expand All @@ -69,7 +69,7 @@ Attributes can be marked to allow filtering and/or sorting. When not allowed, it
```c#
public class Person : Identifiable<int>
{
[Attr(AttrCapabilities.AllowSort | AttrCapabilities.AllowFilter)]
[Attr(Capabilities = AttrCapabilities.AllowSort | AttrCapabilities.AllowFilter)]
public string FirstName { get; set; }
}
```
Expand Down
8 changes: 4 additions & 4 deletions docs/usage/resources/relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ For example, a TodoItem may have an Owner and so the Id attribute should be Owne
```c#
public class TodoItem : Identifiable<int>
{
[Attr("description")]
[Attr]
public string Description { get; set; }

[HasOne("owner")]
[HasOne]
public Person Owner { get; set; }
public int OwnerId { get; set; }
}
Expand All @@ -28,10 +28,10 @@ the @JsonApiDotNetCore.Configuration.JsonApiOptions#JsonApiDotNetCore_Configurat
```c#
public class Person : Identifiable<int>
{
[Attr("first-name")]
[Attr(PublicName = "first-name")]
public string FirstName { get; set; }

[HasMany("todo-items")]
[HasMany(PublicName = "todo-items")]
public ICollection<TodoItem> TodoItems { get; set; }
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/resources/resource-definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ from Entity Framework Core `IQueryable` execution.
There are some cases where you want attributes conditionally excluded from your resource response.
For example, you may accept some sensitive data that should only be exposed to administrators after creation.

Note: to exclude attributes unconditionally, use `Attr[~AttrCapabilities.AllowView]`.
Note: to exclude attributes unconditionally, use `[Attr(Capabilities = ~AttrCapabilities.AllowView)]`.

```c#
public class UserDefinition : ResourceDefinition<User>
Expand Down