CsEffect.Core
0.14.0
See the version list below for details.
dotnet add package CsEffect.Core --version 0.14.0
NuGet\Install-Package CsEffect.Core -Version 0.14.0
<PackageReference Include="CsEffect.Core" Version="0.14.0" />
<PackageVersion Include="CsEffect.Core" Version="0.14.0" />
<PackageReference Include="CsEffect.Core" />
paket add CsEffect.Core --version 0.14.0
#r "nuget: CsEffect.Core, 0.14.0"
#:package CsEffect.Core@0.14.0
#addin nuget:?package=CsEffect.Core&version=0.14.0
#tool nuget:?package=CsEffect.Core&version=0.14.0
CsEffect.Core
Core types and abstractions for the CsEffect system.
Overview
CsEffect.Core provides the foundational types for defining and using effects without any analyzer dependencies. This lightweight package contains only the essential abstractions needed to create and consume effect-aware APIs.
Core Types
IO Base Class
public class IO { }
Base class for all effect definitions. All effects inherit from IO.
Generic Effect Attribute
[Effect<ConsoleEffect>]
public void WriteToConsole() { ... }
Type-safe attribute for declaring effects on methods and properties.
AttachEffect Attribute
[AttachEffect(typeof(Console), "WriteLine", "Write")]
public sealed class ConsoleEffect : IO { }
Attribute for attaching effects to existing types and specific members.
Effect Severity Control
[EffectSeverity(EffectViolationLevel.Error)]
public sealed class CriticalEffect : IO { }
Configures whether effect violations are warnings or errors.
Usage
Defining Effects
// Base effect for console operations
public class ConsoleEffect : IO { }
// Specific console write effect
[AttachEffect(typeof(Console), "WriteLine", "Write")]
public sealed class ConsoleWriteEffect : ConsoleEffect { }
Using Effects
[Effect<ConsoleWriteEffect>]
public void LogMessage(string message)
{
Console.WriteLine(message);
}
// Effect hierarchy - IO satisfies ConsoleWriteEffect
[Effect<IO>]
public void DoLogging()
{
LogMessage("This works due to effect hierarchy");
}
Multiple Effects
[Effect<ConsoleWriteEffect>, Effect<FileWriteEffect>]
public void LogToConsoleAndFile(string message)
{
Console.WriteLine(message);
File.WriteAllText("log.txt", message);
}
Benefits
- đĒļ Lightweight: No analyzer or Roslyn dependencies
- đ¯ Pure: Only contains type definitions and attributes
- đ Reusable: Can be used in any .NET project
- đī¸ Foundational: Base for building effect libraries
- ⥠Fast: Minimal runtime overhead
Integration
This package is designed to work with:
- CsEffect.System: Pre-built system effects (Console, File, HTTP)
- CsEffect.Analyzer: Development-time effect analysis
- CsEffect: Combined package with analyzer and code fixes
Creating Effect Libraries
// 1. Reference CsEffect.Core
// 2. Define your domain effects
[AttachEffect(typeof(Database), "Execute", "Query")]
public sealed class DatabaseEffect : IO { }
// 3. Use in your APIs
[Effect<DatabaseEffect>]
public User GetUser(int id) => database.Query<User>(id);
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CsEffect.Core:
| Package | Downloads |
|---|---|
|
CsEffect.System
Reference effect attribute library providing built-in system-oriented effects for CsEffect consumers. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.15.0 | 236 | 10/13/2025 |
| 0.14.0 | 220 | 10/13/2025 |
| 0.13.0 | 212 | 10/13/2025 |
| 0.12.0 | 222 | 10/13/2025 |
| 0.11.0 | 222 | 10/13/2025 |
| 0.10.0 | 232 | 10/12/2025 |
| 0.9.0 | 238 | 10/12/2025 |
| 0.8.0 | 221 | 10/12/2025 |
| 0.7.0 | 219 | 10/12/2025 |
| 0.6.0 | 206 | 10/12/2025 |
| 0.5.0 | 212 | 10/12/2025 |
| 0.4.0 | 210 | 10/12/2025 |
| 0.3.0 | 157 | 10/11/2025 |
| 0.2.0 | 160 | 10/11/2025 |
| 0.2.0-alpha.12 | 84 | 10/11/2025 |
| 0.1.0 | 129 | 10/11/2025 |
| 0.0.0 | 162 | 10/11/2025 |