concept Loyalty Program in category .net

appears as: Loyalty Program, Loyalty Program
Microservices in .NET Core, Second Edition

This is an excerpt from Manning's book Microservices in .NET Core, Second Edition.

Figure 5.3 includes two different queries: “Get loyalty points for registered user” and “Get settings for registered user.” You’ll handle both of these with the same endpoint that returns a representation of the registered user. The representation includes both the number of loyalty points and the settings. You do this for two reasons: it’s simpler than having two endpoints, and it’s also cleaner because the Loyalty Program microservice gets to expose just one representation of the registered user instead of having to come up with specialized formats for specialized queries.

Listing 5.13. Dockerfile for Special Offers microservice
language="sql" linenumbering="unnumbered">FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src
COPY . .
RUN dotnet restore "SpecialOffers.csproj"
WORKDIR "/src"
RUN dotnet build "SpecialOffers.csproj" -c Release -o /api/build

FROM build AS publish
WORKDIR "/src"
RUN dotnet publish "SpecialOffers.csproj" -c Release -o /api/publish

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS final
WORKDIR /app
EXPOSE 80
COPY --from=publish /api/publish ./api
ENTRYPOINT dotnet api/SpecialOffers.dll
Microservices in .NET Core: with examples in Nancy

This is an excerpt from Manning's book Microservices in .NET Core: with examples in Nancy.

The collaboration between two microservices can use one, two, or all three of these collaboration styles. Each time two microservices need to collaborate, you must decide which style to use. Figure 4.2 shows the collaborations of Loyalty Program again, but this time identifying the collaboration style I chose for each one.

Figure 4.6. The LoyaltyProgramClient component in the Invoice microservice is responsible for making calls to the Loyalty Program microservice. It translates between the contract published by Loyalty Program and the domain model of Invoice.