Skip to content

Commit

Permalink
fix docs issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cihandeniz committed Feb 5, 2025
1 parent ca268b7 commit 0bfecae
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 31 deletions.
2 changes: 1 addition & 1 deletion docs/features/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This feature also registers a custom `IAuthorizationMiddlewareResultHandler`
and this handler directly throws;

- `AuthenticationException` when challenged
- `UnauthorizedAccessExcetpin` when forbidden
- `UnauthorizedAccessException` when forbidden

instead of using `IAuthenticationHandler` fallback methods.

Expand Down
2 changes: 1 addition & 1 deletion docs/features/coding-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ c => c.RichEntity()

Configures transient services as api services. This coding style allows you to
have a public initializer (`With`) with parameters which will render as query
parameters or single `id` parameter wich will render from route.
parameters or single `id` parameter which will render from route.

Rich transients with `id` types can be method parameters and located using
their initializers.
Expand Down
3 changes: 1 addition & 2 deletions docs/features/cors.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ This feature adds `AspNetCore` cors services and middleware.

```csharp
c => c.AspNetCore([...])
}
```

## Disabled
Expand All @@ -24,4 +23,4 @@ You can disable this feature by calling `Disabled()` method;

```csharp
c => c.Disabled()
```
```
8 changes: 8 additions & 0 deletions docs/features/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ Adds MySQL database setup which gets connection parameters from `app.settings`.
c => c.MySql()
```

## Oracle

Adds Oracle database setup which gets connection parameters from `app.settings`.

```csharp
c => c.Oracle()
```

## PostgreSQL

Adds PostgreSQL database setup which gets connection parameters from
Expand Down
34 changes: 17 additions & 17 deletions docs/layers/code-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ app.Layers.AddCodeGeneration();

## Configuration Targets

Code generation layer provides `IGeneratedAssemblyCollection`,
Code generation layer provides `IGeneratedAssemblyCollection`,
`IGeneratedFileCollection` and `GeneratedContext` configuration targets.

### `IGeneratedAssemblyCollection`
Expand All @@ -33,29 +33,29 @@ configurator.ConfigureGeneratedFileCollection(files =>
});
```

### `GeneratedContext`

This target is provided in `BuildConfiguration` phase and contains generated
assemblies and files data. To configure it in a feature;

```csharp
configurator.ConfigureGeneratedFileCollection(files =>
{
...
});
```

## Phases

This layer introduces following `Generate` phases to the application it is added;

- `GenerateCode`: This phase creates a `IGeneratedAssemblyCollection` instance
and places it in the application context
- `Compile`: This phase compiles generated code during above phase, saves
generated assemblies and files to entry assembly location with
- `Compile`: This phase compiles generated code during above phase, saves
generated assemblies and files to entry assembly location with
`ASPNETCORE_ENVIRONMENT` subfolder

> [!TIP]
>
> To access to a generated assembly from a feature use
> `configurator.Context.GetGeneratedContext().Assemblies["MyAssembly"]` extension method.
> To access to a generated assembly or file from a feature use below extension method;
>
> ```csharp
> configurator.UsingGeneratedContext(generatedContext =>
> {
> // generated assembly
> var assembly = generatedContext.Assemblies[...];
>
> // generated file helpers
> var path = generatedContext.Files[...];
> var contentString = generatedContext.ReadFile(...);
> var data = generatedContext.ReadFileAsJson<...>();
> });
> ```
23 changes: 18 additions & 5 deletions docs/layers/domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ app.Layers.AddDomain();
## Configuration Targets

This layer provides `IDomainTypeCollection` and `DomainModelBuilderOptions`
configuration targets for building `DomainModel` in `Generate` mode. It also
configuration targets for building `DomainModel` in `Generate` mode. It also
provides `DomainServiceCollection` configuration target for features to add
`DomainServiceDescriptor` for domain types which then be used to generate an
`IServiceAdder` implementation. The generated `IServiceAdder` is then
`IServiceAdder` implementation. The generated `IServiceAdder` is then
used in `Start` mode for auto registering domain types to service collection.

### `IDomainTypeCollection`
Expand Down Expand Up @@ -42,13 +42,14 @@ configurator.ConfigureDomainBuilderOptions(options =>

### `DomainServiceCollection`

This target is provided in `GenerateCode` phase and it is used to generated
`IServiceAdder` to add domain services during `AddService` phase in `Start`
This target is provided in `GenerateCode` phase and it is used to generated
`IServiceAdder` to add domain services during `AddService` phase in `Start`
mode. To configure it in a feature;

```csharp
configurator.ConfigureDomainServiceCollection(services =>
configurator.ConfigureDomainServiceCollection((services, domain) =>
{
// use domain metadata to register services at generate time
...
});
```
Expand All @@ -61,3 +62,15 @@ This layer introduces following `Generate` phases to the application it is added
application context
- `BuildDomainModel`: This phase uses domain types to build and add a
`DomainModel` instance to the application context

> [!TIP]
>
> To access the domain model from a feature use below extension method;
>
> ```csharp
> configurator.UsingDomainModel(domain =>
> {
> // use domain metadata to configure any configuration target
> ...
> });
> ```
4 changes: 2 additions & 2 deletions docs/recipes/data-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Bake.New

```mermaid
flowchart LR;
subgraph Generate
AD(AddDomainTypes)
BD(BuildDomainModel)
Expand All @@ -74,7 +74,7 @@ flowchart LR;
AD -->|IDomainTypeCollection| BD
BD -->|DomainModel| GC
GC -->|IGeneratedAssemblyCollection<br/>IGeneratedFileCollection<br/>DomainServiceCollection| C
GC -->|IGeneratedAssemblyCollection<br/>IGeneratedFileCollection| C
end
subgraph Start
Expand Down
6 changes: 3 additions & 3 deletions docs/recipes/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Bake.New

```mermaid
flowchart LR;
subgraph Generate
AD(AddDomainTypes)
BD(BuildDomainModel)
Expand All @@ -85,7 +85,7 @@ flowchart LR;
AD -->|IDomainTypeCollection| BD
BD -->|DomainModel| GC
GC -->|IGeneratedAssemblyCollection<br/>IGeneratedFileCollection<br/>DomainServiceCollection| C
GC -->|IGeneratedAssemblyCollection<br/>IGeneratedFileCollection| C
end
subgraph Start
Expand All @@ -104,4 +104,4 @@ flowchart LR;
end
Generate --> Start
```
```

0 comments on commit 0bfecae

Please sign in to comment.