Skip to content

Commit

Permalink
docs: improve formatting of coalesce config builder methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Jan 11, 2024
1 parent 4dd8ced commit 81f9f8b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/topics/startup.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Application Configuration


In order for Coalesce to work in your application, you must register the needed services in your ``Startup.cs`` file. Doing so is simple:
In order for Coalesce to work in your application, you must register the needed services in your `Startup.cs` or `Program.cs`. Doing so is simple:

``` c#
public void ConfigureServices(IServiceCollection services)
Expand Down Expand Up @@ -40,29 +40,29 @@ public void ConfigureServices(IServiceCollection services)
}
```

A summary is as follows:
Available builder methods include:

`.AddContext<AppDbContext>()`
<Prop def="public Builder AddContext<TDbContext>()" />

Register services needed by Coalesce to use the specified context. This is done automatically when calling the `services.AddCoalesce<AppDbContext>();` overload.

`.UseDefaultDataSource(typeof(MyDataSource<,>))`
<Prop def="public Builder UseDefaultDataSource(Type dataSource)" />

Overrides the default data source used, replacing the [Standard Data Source](/modeling/model-components/data-sources.md#standard-data-source). See [Data Sources](/modeling/model-components/data-sources.md) for more details.

`.UseDefaultBehaviors(typeof(MyBehaviors<,>))`
<Prop def="public Builder UseDefaultBehaviors(Type behaviors)" />

Overrides the default behaviors used, replacing the [Standard Behaviors](/modeling/model-components/behaviors.md#standard-behaviors). See [Behaviors](/modeling/model-components/behaviors.md) for more details.

`.UseTimeZone(TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"))`
<Prop def="public Builder UseTimeZone(TimeZoneInfo timeZone)" />

Specify a static time zone that should be used when Coalesce is performing operations on dates/times that lack timezone information. For example, when a user inputs a search term that contains only a date, Coalesce needs to know what timezone's midnight to use when performing the search.

`.UseTimeZone<ITimeZoneResolver>()`
<Prop def="public Builder UseTimeZone<ITimeZoneResolver>()" />

Specify a service implementation to use to resolve the current timezone. This should be a scoped service, and will be automatically registered if it is not already. This allows retrieving timezone information on a per-request basis from HTTP headers, Cookies, or any other source.

`.Configure(...)`
<Prop def="public Builder Configure(Action<CoalesceOptions> setupAction)" />

Configure additional options for Coalesce runtime behavior. Current options include options for server-side validation, and options for exception handling. See individual members for details.

Expand Down

0 comments on commit 81f9f8b

Please sign in to comment.