diff --git a/docs/getting-started/step-by-step.md b/docs/getting-started/step-by-step.md index 2520f4f0dc..ba59a29838 100644 --- a/docs/getting-started/step-by-step.md +++ b/docs/getting-started/step-by-step.md @@ -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; } } ``` @@ -61,7 +61,7 @@ public class AppDbContext : DbContext ### Define Controllers -You need to create controllers that inherit from `JsonApiController` or `JsonApiController` +You need to create controllers that inherit from `JsonApiController` or `JsonApiController` where `T` is the model that inherits from `Identifiable` ```c# diff --git a/docs/usage/extensibility/controllers.md b/docs/usage/extensibility/controllers.md index 1040d33f1b..82e98796db 100644 --- a/docs/usage/extensibility/controllers.md +++ b/docs/usage/extensibility/controllers.md @@ -1,6 +1,6 @@ # Controllers -You need to create controllers that inherit from `JsonApiController` +You need to create controllers that inherit from `JsonApiController` ```c# public class ArticlesController : JsonApiController
diff --git a/docs/usage/extensibility/services.md b/docs/usage/extensibility/services.md index 84d7ac3897..98fbf3fc85 100644 --- a/docs/usage/extensibility/services.md +++ b/docs/usage/extensibility/services.md @@ -21,11 +21,11 @@ public class TodoItemService : JsonApiResourceService IPaginationContext paginationContext, IJsonApiOptions options, ILoggerFactory loggerFactory, - ICurrentRequest currentRequest, + IJsonApiRequest request, IResourceChangeTracker 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; @@ -47,7 +47,7 @@ public class TodoItemService : JsonApiResourceService ## 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` implementation. +If you'd like to use another ORM that does not provide what JsonApiResourceService depends upon, you can use a custom `IResourceService` implementation. ```c# // Startup.cs diff --git a/docs/usage/resources/attributes.md b/docs/usage/resources/attributes.md index e9850648cf..fab38aa4d5 100644 --- a/docs/usage/resources/attributes.md +++ b/docs/usage/resources/attributes.md @@ -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; } } ``` @@ -45,7 +45,7 @@ Attributes can be marked to allow returning their value in responses. When not a ```c# public class User : Identifiable { - [Attr(~AttrCapabilities.AllowView)] + [Attr(Capabilities = ~AttrCapabilities.AllowView)] public string Password { get; set; } } ``` @@ -57,7 +57,7 @@ Attributes can be marked as mutable, which will allow `PATCH` requests to update ```c# public class Person : Identifiable { - [Attr(AttrCapabilities.AllowMutate)] + [Attr(Capabilities = AttrCapabilities.AllowChange)] public string FirstName { get; set; } } ``` @@ -69,7 +69,7 @@ Attributes can be marked to allow filtering and/or sorting. When not allowed, it ```c# public class Person : Identifiable { - [Attr(AttrCapabilities.AllowSort | AttrCapabilities.AllowFilter)] + [Attr(Capabilities = AttrCapabilities.AllowSort | AttrCapabilities.AllowFilter)] public string FirstName { get; set; } } ``` diff --git a/docs/usage/resources/relationships.md b/docs/usage/resources/relationships.md index 7b6813c536..b501c6e984 100644 --- a/docs/usage/resources/relationships.md +++ b/docs/usage/resources/relationships.md @@ -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 { - [Attr("description")] + [Attr] public string Description { get; set; } - [HasOne("owner")] + [HasOne] public Person Owner { get; set; } public int OwnerId { get; set; } } @@ -28,10 +28,10 @@ the @JsonApiDotNetCore.Configuration.JsonApiOptions#JsonApiDotNetCore_Configurat ```c# public class Person : Identifiable { - [Attr("first-name")] + [Attr(PublicName = "first-name")] public string FirstName { get; set; } - [HasMany("todo-items")] + [HasMany(PublicName = "todo-items")] public ICollection TodoItems { get; set; } } ``` diff --git a/docs/usage/resources/resource-definitions.md b/docs/usage/resources/resource-definitions.md index d35f2e301f..ad92a64c1b 100644 --- a/docs/usage/resources/resource-definitions.md +++ b/docs/usage/resources/resource-definitions.md @@ -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