IBeam.Api
2.0.63
See the version list below for details.
dotnet add package IBeam.Api --version 2.0.63
NuGet\Install-Package IBeam.Api -Version 2.0.63
<PackageReference Include="IBeam.Api" Version="2.0.63" />
<PackageVersion Include="IBeam.Api" Version="2.0.63" />
<PackageReference Include="IBeam.Api" />
paket add IBeam.Api --version 2.0.63
#r "nuget: IBeam.Api, 2.0.63"
#:package IBeam.Api@2.0.63
#addin nuget:?package=IBeam.Api&version=2.0.63
#tool nuget:?package=IBeam.Api&version=2.0.63
IBeam.Api
IBeam.Api provides reusable API primitives for consistent ASP.NET Core endpoints:
- Standardized success/error response envelopes (
ApiResponse,ApiPagedResponse) - Global exception middleware (
UseApiExceptionHandling) - API configuration/DI helpers (
AddIBeamApi) - Reusable base controllers (
ApiControllerBase,CrudControllerBase)
Quick Start
Register API services:
builder.Services.AddIBeamApi(builder.Configuration);
Use middleware:
app.UseApiExceptionHandling();
CrudControllerBase
CrudControllerBase<TService, TEntity, TKey> is an opt-in baseline controller with route defaults and operation flags.
- Base route:
api/[controller] GetByIdenabled by default- Other operations disabled by default (
GetAll,GetByIds,Post,Put,Delete) - Strongly-typed async service contracts (no
dynamic)
Service Contracts
Implement the contracts you need in your service:
IGetAllService<TEntity>IGetAllWithArchivedService<TEntity>IGetByIdService<TEntity, TKey>IGetByIdsService<TEntity, TKey>ICreateService<TEntity>IUpdateService<TEntity>IDeleteService<TKey>
Example
using IBeam.Api.Abstractions;
using IBeam.Api.Controllers;
using Microsoft.AspNetCore.Mvc;
public sealed record Patient(Guid Id, string Name);
public interface IPatientService :
IGetByIdService<Patient, Guid>,
IGetAllService<Patient>,
ICreateService<Patient>,
IUpdateService<Patient>,
IDeleteService<Guid>;
[ApiController]
[Route("api/[controller]")]
public sealed class PatientsController : CrudControllerBase<IPatientService, Patient, Guid>
{
public PatientsController(IPatientService service) : base(service) { }
protected override bool AllowGetAll => true;
protected override bool AllowPost => true;
protected override bool AllowPut => true;
protected override bool AllowDelete => true;
}
Created (201) Behavior
For POST, default response is 200 OK with envelope.
If you want 201 Created, override:
ReturnCreatedOnPost⇒trueBuildCreatedRouteValues(TEntity createdEntity)with route values forGetById
Notes
- Exceptions should bubble to
ApiExceptionMiddlewarefor centralized handling. - If an enabled action is missing the required service contract, an
InvalidOperationExceptionis thrown to fail fast with clear diagnostics.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- IBeam.Utilities (>= 2.0.63)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on IBeam.Api:
| Package | Downloads |
|---|---|
|
IBeam.Identity.Services
IBeam modular framework components for .NET APIs and services. |
|
|
IBeam.Identity.Repositories.AzureTable
IBeam modular framework components for .NET APIs and services. |
|
|
IBeam.Services.Logging
IBeam modular framework components for .NET APIs and services. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.9.1 | 56 | 7/23/2026 |
| 2.9.0 | 90 | 7/21/2026 |
| 2.8.2 | 76 | 7/21/2026 |
| 2.8.1 | 80 | 7/21/2026 |
| 2.8.0 | 81 | 7/21/2026 |
| 2.7.0 | 89 | 7/21/2026 |
| 2.6.0 | 145 | 7/20/2026 |
| 2.5.0 | 142 | 7/17/2026 |
| 2.4.2 | 141 | 7/16/2026 |
| 2.4.1 | 129 | 7/14/2026 |
| 2.4.0 | 131 | 6/24/2026 |
| 2.3.0 | 122 | 6/24/2026 |
| 2.2.0 | 134 | 6/23/2026 |
| 2.1.0 | 127 | 6/23/2026 |
| 2.0.68 | 120 | 6/23/2026 |
| 2.0.66 | 123 | 6/22/2026 |
| 2.0.65 | 127 | 6/22/2026 |
| 2.0.64 | 189 | 6/17/2026 |
| 2.0.63 | 127 | 6/16/2026 |
| 2.0.62 | 132 | 6/16/2026 |