PolicyModelExtensions¶
Small conversion helpers used by the policy page model: parse a posted string to a number and copy header values into the context.
Purpose¶
- Turn the posted context text into a policy number (BR-BOLMIDDLEWARE-008).
- Keep the context in step with the loaded header (BR-BOLMIDDLEWARE-011).
Context¶
- Namespace:
BolMiddleware.Services.Context - Assembly/package:
BolMiddleware
Public members¶
| Member | Signature | Purpose |
|---|---|---|
ToLong |
static long ToLong(this string value) |
Parses the text to a number and returns 0 when parsing fails. |
UpdateFromHeader |
static void UpdateFromHeader(this ContextHelper helper, PolicyHeader header) |
Sets the policy number, agency number, and producer number on the context from the header. |
Behavioral notes¶
- A zero result cannot be told apart from a failed parse.
Constraints and usage notes¶
UpdateFromHeadermutates the helper.
Sources¶
- src/BolMiddleware/Services/Context/PolicyModelExtensions.cs