Ozcorps.Core
9.0.0
See the version list below for details.
dotnet add package Ozcorps.Core --version 9.0.0
NuGet\Install-Package Ozcorps.Core -Version 9.0.0
<PackageReference Include="Ozcorps.Core" Version="9.0.0" />
<PackageVersion Include="Ozcorps.Core" Version="9.0.0" />
<PackageReference Include="Ozcorps.Core" />
paket add Ozcorps.Core --version 9.0.0
#r "nuget: Ozcorps.Core, 9.0.0"
#:package Ozcorps.Core@9.0.0
#addin nuget:?package=Ozcorps.Core&version=9.0.0
#tool nuget:?package=Ozcorps.Core&version=9.0.0
Ozcorps.Core
Ozcorps.Core is a multi-targeted utility package for ASP.NET Core applications.
It provides reusable building blocks for response modeling, dynamic query operations, encryption helpers, geometry conversion utilities, and Elasticsearch integration.
Target Frameworks
net8.0net9.0net10.0
Installation
dotnet add package Ozcorps.Core --version 9.0.0
What's Included
Ozcorps.Core.Models.Response<T>andResponse- Dynamic query helpers in
Ozcorps.Core.Extensions.QueryExtensions - Geometry conversion and projection helpers in
Ozcorps.Core.Extensions.GeometryExtensions - Encryption abstractions and implementations (
IEncryptor,IFileEncryptor,Md5Encryptor,RsaEncryptor,FileEncryptor) - Elasticsearch provider and generic service (
IElasticSearchProvider,IElasticSearchService<T>) - Security headers middleware (
HeadersMiddleware,HeaderOption)
Response Model
Use a consistent API response contract:
using Ozcorps.Core.Models;
var success = Response<string>.Ok("done", "Operation completed");
var failed = Response<string>.Fail("Validation failed", new Dictionary<string, string[]>
{
["Email"] = new[] { "Email is required" }
});
Response<T> includes:
DataSuccessMessageErrorsTraceIdTimestamp
Encryption Services
Register encryption services from DI extensions:
using Microsoft.Extensions.DependencyInjection;
builder.Services.AddRsaEncryptor();
builder.Services.AddMd5Encryptor();
builder.Services.AddFileEncryptor();
Required Configuration
RsaEncryptor expects:
{
"Rsa": {
"Public": "base64-public-key",
"Private": "base64-private-key"
}
}
Md5Encryptor uses:
{
"Md5Key": "your-secret-key"
}
Elasticsearch Integration
Register provider and generic service:
using Microsoft.Extensions.DependencyInjection;
builder.Services.AddElasticSearchProvider();
Configuration:
{
"ElasticSearch": {
"Host": "http://localhost:9200"
}
}
Usage:
public class ProductSearchService
{
private readonly IElasticSearchService<Product> _service;
public ProductSearchService(IElasticSearchService<Product> service)
{
_service = service;
}
public IQueryable<Product> Search(string index)
{
return _service.Search(index, page: 0, rowCount: 20);
}
}
Query Extensions
QueryExtensions supports runtime filtering, searching, ordering, and pagination over IQueryable.
Example:
var filtered = query.SearchAnd(
new[] { "Name", "Status" },
new[] { "john", "active" },
new[] { "contains", "==" });
var ordered = filtered.OrderHelper(
new[] { "asc" },
new[] { "Name" });
Geometry Extensions
The geometry helpers are based on NetTopologySuite and ProjNet.
Capabilities include:
- WKT/WKB conversions
- Simplification
- SRID transformations (WGS84, WebMercator, TM, UTM variants)
Example:
using Ozcorps.Core.Extensions;
var geometry = "POINT(29.0 41.0)".WktToGeometry();
var mercator = geometry.ToWebMerkator();
var wkt = mercator.ToWkt();
Headers Middleware
HeadersMiddleware allows adding/removing security-related response headers using HeaderOption.
You can configure it in your pipeline by constructing HeaderOption and invoking the middleware.
Notes
- Package metadata includes
PackageReadmeFile, and this file is packed into the NuGet package. - XML documentation file generation is enabled.
- Elasticsearch integration uses the
Nest7.x client.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. 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 is compatible. 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. |
-
net10.0
- Microsoft.AspNetCore.Http (>= 2.2.2)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.4)
- Microsoft.Extensions.Options (>= 7.0.1)
- Nest (>= 7.17.5)
- NetTopologySuite (>= 2.5.0)
- Ozcorps.DynamicLinq (>= 1.2.1)
- ProjNet (>= 2.0.0)
-
net8.0
- Microsoft.AspNetCore.Http (>= 2.2.2)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.4)
- Microsoft.Extensions.Options (>= 7.0.1)
- Nest (>= 7.17.5)
- NetTopologySuite (>= 2.5.0)
- Ozcorps.DynamicLinq (>= 1.2.1)
- ProjNet (>= 2.0.0)
-
net9.0
- Microsoft.AspNetCore.Http (>= 2.2.2)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.4)
- Microsoft.Extensions.Options (>= 7.0.1)
- Nest (>= 7.17.5)
- NetTopologySuite (>= 2.5.0)
- Ozcorps.DynamicLinq (>= 1.2.1)
- ProjNet (>= 2.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Ozcorps.Core:
| Package | Downloads |
|---|---|
|
Ozcorps.Logger
Package Description |
|
|
Ozcorps.Ozt
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.