DAMA.Software.ValidateCourse
1.2.0
dotnet add package DAMA.Software.ValidateCourse --version 1.2.0
NuGet\Install-Package DAMA.Software.ValidateCourse -Version 1.2.0
<PackageReference Include="DAMA.Software.ValidateCourse" Version="1.2.0" />
<PackageVersion Include="DAMA.Software.ValidateCourse" Version="1.2.0" />
<PackageReference Include="DAMA.Software.ValidateCourse" />
paket add DAMA.Software.ValidateCourse --version 1.2.0
#r "nuget: DAMA.Software.ValidateCourse, 1.2.0"
#:package DAMA.Software.ValidateCourse@1.2.0
#addin nuget:?package=DAMA.Software.ValidateCourse&version=1.2.0
#tool nuget:?package=DAMA.Software.ValidateCourse&version=1.2.0
DAMA.Software.ValidateCourse
Shared gRPC contract for CourseManagement → ClassAttendance and CourseManagement → Payment communication in the DAMA microservices stack.
What it contains
Two Protobuf service definitions under Protos/:
class_existence.proto—ClassExistence.ScheduledExists(ScheduledExistsRequest) → ClassExistsResponseandClassExistence.UniqueExists(UniqueExistsRequest) → ClassExistsResponse. Implemented byCourseManagementService; consumed byClassAttendanceServiceto confirm a scheduled or unique class exists before recording attendance.course_existence.proto—CourseExistence.Exists(CourseExistsRequest) → CourseExistsResponse. Implemented byCourseManagementService; consumed byPaymentServiceto validate aCourseIdwhen creating aDebtTemplate.
Grpc.Tools generates both the client and server stubs at build time (GrpcServices="Both"), so the same package serves both consumer and producer.
Usage
Add the package to a Backend.csproj:
<PackageReference Include="DAMA.Software.ValidateCourse" Version="1.0.0" />
Server side (CourseManagementService)
builder.Services.AddGrpc();
// ...
app.MapGrpcService<ClassExistenceGrpcService>();
app.MapGrpcService<CourseExistenceGrpcService>();
Where ClassExistenceGrpcService derives from ClassExistence.ClassExistenceBase and CourseExistenceGrpcService derives from CourseExistence.CourseExistenceBase.
Client side (e.g. ClassAttendanceService)
builder.Services.AddGrpcClient<ClassExistence.ClassExistenceClient>(o =>
o.Address = new Uri(builder.Configuration["Services:CourseManagementUrl"]!))
.AddInterceptor<JwtForwardClientInterceptor>();
The Authorization header is forwarded by an interceptor that lifts the bearer token off IHttpContextAccessor and writes it to the gRPC metadata under key authorization. The standard ASP.NET Core JwtBearer middleware on the server validates it without modification.
Client side (e.g. PaymentService)
builder.Services.AddGrpcClient<CourseExistence.CourseExistenceClient>(o =>
o.Address = new Uri(builder.Configuration["Services:CourseManagementUrl"]!))
.AddInterceptor<JwtForwardClientInterceptor>();
Wire format notes
Guidfields are serialized as canonical"D"strings, notbytes, for log readability.DateOnlyfields are serialized as"yyyy-MM-dd"strings.- Field tags are stable; never reuse a tag number after deletion — mark
reservedinstead. - New optional fields can be added without breaking existing clients as long as new tag numbers are used.
Generated namespace
DAMA.Software.ValidateCourse.Grpc
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Google.Protobuf (>= 3.28.2)
- Grpc.AspNetCore.Server (>= 2.66.0)
- Grpc.Net.ClientFactory (>= 2.66.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.