SAIF.NetCore.Common operations and processes¶
This page is the operation catalog and cross-operation hub for this library. SAIF.NetCore.Common has no business workflows, endpoints, or entry points of its own; its "operations" are reusable utility capabilities that consumers call directly. Each operation's detailed, step-by-step logic lives in its own page under operations/.
Operation catalog¶
| Operation | Intent | Trigger | Inputs | Outputs | Rules | Tables | SQL |
|---|---|---|---|---|---|---|---|
| Title-case a string | Normalize free-text input into title case while preserving organization abbreviations, Roman numerals, US state/direction codes, and listed lowercase articles/prepositions. | A consumer calls StringExtensions.ToTitleCase(value). |
value (string) |
The title-cased string, or the original value unchanged for null/empty input. | BR-019 | — | — |
| Evaluate date-range overlap and validity | Determine whether DateRange values are individually valid, overlap pairwise or across an ordered sequence, form a contiguous sequence, or contain/are matched by a given date. |
A consumer calls DateRangeExtensions.IsOverlapping, IsValidRange/IsOpenEnded/IsFutureRange/IsPastRange, IsContiguous, IsOverLapping (sequence form), IsInRange, AsOf<T>, ContainsDateRange, or ContainsBeginDate. |
range1/range2 (DateRange) or an IEnumerable<DateRange>/IEnumerable<T>, plus policy/date arguments as applicable |
A bool for most members; IEnumerable<T> for AsOf<T>. |
BR-012, BR-013, BR-014, BR-015, BR-016 | — | — |
| Classify nullable date-range overlap state | Classify the relationship between two open-ended-capable date ranges into one of ten specific overlap categories. | A consumer calls NullableDateRange.GetOverlapState(rangeA, rangeB). |
rangeA, rangeB (NullableDateRange, each with a required StartDate and nullable EndDate) |
A DateRangeOverlapResult enum value. |
— | — | — |
| Validate and convert Julian dates | Validate a Julian-format date string or integer and convert it to a DateTime, or convert a DateTime into Julian format. |
A consumer calls Julian.IsValid, Julian.GetYear, Julian.ToDate, or the DateTime.ToJulian() extension method. |
julian (string or int), optional millenium (int), yearLength (int, for ToJulian) |
IsValid returns bool with an out message; ToDate returns DateTime; ToJulian returns string. |
BR-017 | — | — |
| Build EDI-style date strings | Parse EDI-format date/time strings into a DateTime, split a delimited date-range string, or render a date (or date range) back into EDI-style text. |
A consumer calls DateMaker.MakeDateTime, .ExtractDateRange, or .EdiFileDateString. |
date (string, yyyyMMdd or yyMMdd), optional time (string, default "000000"); or value (string, --delimited); or start/end (DateTime/DateTime?) |
A DateTime (MakeDateTime), two out DateTime values (ExtractDateRange), or a formatted string (EdiFileDateString). |
BR-018 | — | — |
| Format exception chains for logging | Render an exception and its full InnerException chain into a human-readable multi-exception report, or a compact log-and-display pair. |
A consumer calls ExceptionExtensions.GetFullFormattedException or .GetErrorLogFormattedException in a catch block. |
ex (Exception), optional innerToOuter (bool, default true) |
A formatted string report. | — | — | — |
| Enforce argument and state guard clauses | Centralize null/empty/condition validation for method arguments and object state, throwing a typed exception on failure. | A consumer or an internal library call site invokes any Enforce.* guard-clause member at the start of a method. |
value/name (for null/empty checks), condition (bool or Func<bool>), optional Exception instance. |
No return value on success for the four Enforce.True overloads; ArgumentNotNull<T>, ArgumentNotNullOrEmpty, ArgumentNotNullOrWhiteSpace, and NotNull<T> instead return the validated T/string value on success, enabling fluent call sites. A thrown exception on failure for every member. |
BR-001, BR-002, BR-003, BR-004, BR-005 | — | — |
| Assemble a validation result and exception | Collect one or more validation failures into a ValidationResult and optionally wrap it in a throwable SaifValidationException. |
A consumer populates a ValidationResult after running validation logic, or constructs a SaifValidationException to report a single failure. |
PropertyName, ErrorMessage, AttemptedValue (for ValidationFailure); or propertyName/errorMessage (for SaifValidationException) |
A ValidationResult with populated Errors/Messages, or a SaifValidationException carrying a ValidationResult. |
BR-020 | — | — |
| Search and strip byte-array headers | Locate a byte or text pattern within a byte array and optionally strip bytes preceding it, for example removing junk bytes before a PDF file header. | A consumer calls ByteExtensions.Search or .StripHeader on a byte[]. |
bytes (byte[]), searchFor (string or byte[]), optional start (int, default 0), maxBytesToSearch (int) |
Search returns the match position or -1; StripHeader returns a (possibly trimmed) byte[] and an out bool found. |
BR-021 | — | — |
Process flow diagram¶
The following diagram visualizes how a consumer typically selects and exercises one of this library's utility operations.
flowchart TD
Start([Consumer code]) --> Pick{What is being done?}
Pick -->|Format text| OP1["OP-01: Title-case a string"]
Pick -->|Test/filter ranges| OP2["OP-02: Evaluate date-range<br>overlap and validity"]
Pick -->|Classify ranges| OP3["OP-03: Classify nullable<br>date-range overlap state"]
Pick -->|Convert Julian date| OP4["OP-04: Validate and convert<br>Julian dates"]
Pick -->|Build EDI date| OP5["OP-05: Build EDI-style<br>date strings"]
Pick -->|Log an error| OP6["OP-06: Format exception<br>chains for logging"]
Pick -->|Guard an argument| OP7["OP-07: Enforce argument<br>and state guard clauses"]
Pick -->|Report validation| OP8["OP-08: Assemble a validation<br>result and exception"]
Pick -->|Process a byte stream| OP9["OP-09: Search and strip<br>byte-array headers"]
OP1 --> Used([Result used by caller])
OP2 --> Used
OP3 --> Used
OP4 --> Used
OP5 --> Used
OP6 --> Used
OP7 --> Used
OP8 --> Used
OP9 --> Used
Failure and edge-case behavior¶
- None of the operations on this page read or write a database or issue SQL; the library has zero data-access surface.
- None of the operations delegate into a referenced library, because the library has no
SAIF.NetCore.*or third-party package dependencies. - See each operation's own
## Failure and edge-case behaviorfor its specific validation and error paths.
Related documentation¶
Sources¶
src/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/Extensions/StringExtensions.cssrc/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/InternalUtility/TitleCase.cssrc/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/Extensions/DateRangeExtensions.cssrc/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/Types/DateRange.cssrc/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/Types/NullableDateRange.cssrc/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/Helpers/Julian.cssrc/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/Helpers/DateMaker.cssrc/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/Extensions/ExceptionExtensions.cssrc/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/Helpers/Enforce.cssrc/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/Types/ValidationResult.cssrc/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/Types/ValidationFailure.cssrc/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/Types/SaifValidationException.cssrc/SAIF.NetCore.Common/SAIF.NetCore.Common/SAIF.NetCore.Common/Extensions/ByteExtensions.cs