Skip to content

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

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

  • UpdateFromHeader mutates the helper.

Sources

  • src/BolMiddleware/Services/Context/PolicyModelExtensions.cs