From c7c0ebd4d5ebd74290e52f51ef984d5a09d950bf Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Tue, 28 May 2024 12:32:53 -0700 Subject: [PATCH] nit: Add word to services.md --- docs/modeling/model-types/services.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modeling/model-types/services.md b/docs/modeling/model-types/services.md index b01c8f713..8ab882a5d 100644 --- a/docs/modeling/model-types/services.md +++ b/docs/modeling/model-types/services.md @@ -1,7 +1,7 @@ # Services -In a Coalesce application, you are likely to end up with a need for some API endpoints that aren't closely tied with your regular data model. While you could stick [Static Methods](/modeling/model-components/methods.md#static-methods) on one of your entities, do so is detrimental to the organization of your code. +In a Coalesce application, you are likely to end up with a need for some API endpoints that aren't closely tied with your regular data model. While you could stick [Static Methods](/modeling/model-components/methods.md#static-methods) on one of your entities, to do so is detrimental to the organization of your code. Instead, Coalesce allows you to generate API Controllers and a TypeScript client from a service. A service, in this case, is nothing more than a C# class or an interface with methods on it, annotated with `[Coalesce, Service]`. An implementation of this class or interface must be injectable from your application's service container, so a registration in Startup.cs is needed. @@ -61,4 +61,4 @@ public class Startup } ``` -While it isn't required that an interface for your service exist (you can generate directly from the implementation), it is highly recommended that an interface be used. Interfaces increase testability and reduce risk of accidentally changing the signature of a published API, among other benefits. \ No newline at end of file +While it isn't required that an interface for your service exist (you can generate directly from the implementation), it is highly recommended that an interface be used. Interfaces increase testability and reduce risk of accidentally changing the signature of a published API, among other benefits.