136 lines
7.1 KiB
HTML
136 lines
7.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Introduction | CapyKit Documentation </title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="title" content="Introduction | CapyKit Documentation ">
|
|
|
|
|
|
<link rel="icon" href="favicon.ico">
|
|
<link rel="stylesheet" href="public/docfx.min.css">
|
|
<link rel="stylesheet" href="public/main.css">
|
|
<meta name="docfx:navrel" content="toc.html">
|
|
<meta name="docfx:tocrel" content="toc.html">
|
|
|
|
<meta name="docfx:rel" content="">
|
|
|
|
|
|
|
|
<meta name="loc:inThisArticle" content="In this article">
|
|
<meta name="loc:searchResultsCount" content="{count} results for "{query}"">
|
|
<meta name="loc:searchNoResults" content="No results for "{query}"">
|
|
<meta name="loc:tocFilter" content="Filter by title">
|
|
<meta name="loc:nextArticle" content="Next">
|
|
<meta name="loc:prevArticle" content="Previous">
|
|
<meta name="loc:themeLight" content="Light">
|
|
<meta name="loc:themeDark" content="Dark">
|
|
<meta name="loc:themeAuto" content="Auto">
|
|
<meta name="loc:changeTheme" content="Change theme">
|
|
<meta name="loc:copy" content="Copy">
|
|
<meta name="loc:downloadPdf" content="Download PDF">
|
|
|
|
<script type="module" src="./public/docfx.min.js"></script>
|
|
|
|
<script>
|
|
const theme = localStorage.getItem('theme') || 'auto'
|
|
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="">
|
|
<header class="bg-body border-bottom">
|
|
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
|
|
<div class="container-xxl flex-nowrap">
|
|
<a class="navbar-brand" href="index.html">
|
|
<img id="logo" class="svg" src="logo.svg" alt="CapyKit Documentation">
|
|
CapyKit Documentation
|
|
</a>
|
|
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
|
|
<i class="bi bi-three-dots"></i>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navpanel">
|
|
<div id="navbar">
|
|
<form class="search" role="search" id="search">
|
|
<i class="bi bi-search"></i>
|
|
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="container-xxl">
|
|
|
|
<div class="content">
|
|
<div class="actionbar">
|
|
|
|
<nav id="breadcrumb"></nav>
|
|
</div>
|
|
|
|
<article data-uid="">
|
|
<h1 id="introduction">Introduction</h1>
|
|
|
|
<p>CapyKit is a practical toolkit for .NET applications. It collects common helpers and extension methods into one package so application code can stay focused on business behavior instead of re-implementing the same plumbing in every project.</p>
|
|
<p>The project began as shared infrastructure for HappyCapy and is now available as a standalone library. It currently targets .NET 8.</p>
|
|
<h2 id="what-capykit-provides">What CapyKit Provides</h2>
|
|
<h3 id="extension-methods">Extension Methods</h3>
|
|
<p>The <code>CapyKit.Extensions</code> namespace contains helpers for common language and LINQ tasks:</p>
|
|
<ul>
|
|
<li><code>StringExtensions</code> provides fallback helpers such as <code>IfNullOrEmpty</code> and <code>IfNullOrWhiteSpace</code>.</li>
|
|
<li><code>LINQExtensions</code> adds pagination, page counts, inverted filtering, and left outer join helpers for enumerable and queryable collections.</li>
|
|
<li><code>EnumerationExtensions</code> makes enum names, numeric values, descriptions, and human-readable names easier to retrieve.</li>
|
|
<li><code>ObjectExtensions</code> copies matching writable properties from one object to another.</li>
|
|
</ul>
|
|
<h3 id="helper-classes">Helper Classes</h3>
|
|
<p>The <code>CapyKit.Helpers</code> namespace contains focused utility classes:</p>
|
|
<ul>
|
|
<li><code>SerializationHelper</code> serializes and deserializes values with <code>System.Text.Json</code>.</li>
|
|
<li><code>CompressionHelper</code> compresses serialized values with gzip and can represent compressed data as Base64.</li>
|
|
<li><code>SecurityHelper</code> creates PBKDF2 password hashes, salts, random strings, and random passwords.</li>
|
|
<li><code>KeyHelper</code> creates and validates formatted HMAC-backed keys using a caller-provided master key.</li>
|
|
<li><code>CalculationHelper</code> includes distance calculations, unit conversion, angle conversion, and quick non-cryptographic hash helpers.</li>
|
|
<li><code>LanguageHelper</code> converts camel case identifiers into human-readable text.</li>
|
|
</ul>
|
|
<h3 id="core-utility-types">Core Utility Types</h3>
|
|
<p>The root <code>CapyKit</code> namespace includes small types that support the helpers:</p>
|
|
<ul>
|
|
<li><code>Password</code>, <code>IPasswordAlgorithm</code>, and <code>Pbkdf2Algorithm</code> model password hashing.</li>
|
|
<li><code>Pool<T></code> and <code>PoolItem<T></code> provide a simple resource pool abstraction.</li>
|
|
<li><code>PropertyComparer<T, U></code> compares objects by a selected property.</li>
|
|
<li><code>CapyEventReporter</code>, <code>CapyEventArgs</code>, and <code>EventLevel</code> expose library diagnostics without requiring a specific logging package.</li>
|
|
<li><code>NamedColor</code> provides a large named color enumeration based on the XKCD color survey palette.</li>
|
|
</ul>
|
|
<h2 id="design-approach">Design Approach</h2>
|
|
<p>CapyKit favors explicit, discoverable APIs. Most helpers are static methods or extension methods and can be adopted independently. You can use only the namespaces you need, and the library does not impose dependency injection, hosting, logging, or configuration conventions on the consuming application.</p>
|
|
<p>Where CapyKit needs to communicate warnings or errors internally, it uses <code>CapyEventReporter</code>. Applications can subscribe to these events and map them into their preferred logging, telemetry, or diagnostics system.</p>
|
|
<h2 id="api-reference">API Reference</h2>
|
|
<p>The generated API reference is available through the DocFX navigation and starts at <a href="api/toc.html">API Reference</a>. Use it for exact signatures, overloads, return types, exceptions, and XML comment details.</p>
|
|
|
|
</article>
|
|
|
|
<div class="contribution d-print-none">
|
|
</div>
|
|
|
|
<div class="next-article d-print-none border-top" id="nextArticle"></div>
|
|
|
|
</div>
|
|
|
|
<div class="affix">
|
|
<nav id="affix"></nav>
|
|
</div>
|
|
</main>
|
|
|
|
<div class="container-xxl search-results" id="search-results"></div>
|
|
|
|
<footer class="border-top text-secondary">
|
|
<div class="container-xxl">
|
|
<div class="flex-fill">
|
|
<span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|