OwlDomain.Common
1.2.0
Prefix Reserved
dotnet add package OwlDomain.Common --version 1.2.0
NuGet\Install-Package OwlDomain.Common -Version 1.2.0
<PackageReference Include="OwlDomain.Common" Version="1.2.0" />
<PackageVersion Include="OwlDomain.Common" Version="1.2.0" />
<PackageReference Include="OwlDomain.Common" />
paket add OwlDomain.Common --version 1.2.0
#r "nuget: OwlDomain.Common, 1.2.0"
#addin nuget:?package=OwlDomain.Common&version=1.2.0
#tool nuget:?package=OwlDomain.Common&version=1.2.0
OwlDomain.Common
A package that contains commonly used features and extensions.
Usage
The best way (in our opinion), to use this package is by using C#'s global usings for the parts of the package that you want, for example:
global using OwlDomain.Common.Locking;
global using OwlDomain.Common.Exceptions;
global using OwlDomain.Common.Guards;
DisposableBase
The OwlDomain.Common.DisposableBase
class is an abstract class that lets you easily follow the disposable pattern.
ObservableBase
The OwlDomain.Common.Observable.ObservableBase
class is an abstract class that lets you raise PropertyChanging
and PropertyChanged
events.
Enum extensions
The OwlDomain.Common.Enums.EnumExtensions
class contains several extension methods for working with enums.
Locking extensions
The OwlDomain.Common.Locking
namespace contains various types for making thread locking mechanisms easier to use, where instead of doing:
SemaphoreSlim semaphore = ...;
semaphore.Wait();
try
{
// Code goes here.
}
finally
{
semaphore.Release();
}
you can instead do:
SemaphoreSlim semaphore = ...;
using (semaphore.Lock())
{
// Code goes here.
}
The same approach is also available for the System.Threading.ReaderWriterLockSlim
class.
Throw helpers
The OwlDomain.Common.Exceptions.Throw
class acts as an entry point for throwing new exceptions through the following patterns:
// Throws System.Exception.
Throw.New.Exception("Exception message");
// Throws System.Exception, pretends to return a string value.
return Throw.New.Exception<string>("Exception message");
Argument guards
The OwlDomain.Common.Guards
namespace contains extension methods that act as argument guards, and are used in the following way:
static void Foo(int value)
{
// Throws System.ArgumentOutOfRangeException for the value parameter if it's < 5.
value.ThrowIfLessThan(5);
}
License
This project (the source, the release files, e.t.c) is released under the OwlDomain License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | 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.1
- OwlDomain.Polyease (>= 1.3.5)
-
net5.0
- OwlDomain.Polyease (>= 1.3.5)
-
net6.0
- OwlDomain.Polyease (>= 1.3.5)
-
net7.0
- OwlDomain.Polyease (>= 1.3.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.2.0 [17-05-2025]:
- Enum guards (ThrowIfWithoutFlag).
- String guards (IsEmpty/White-space).
- Updated readme files.
v1.1.1 [07-05-2025]:
- Updated readme files (why do I always forget).
- Added some extra NuGet package tags.
v1.1.0 [07-05-2025]:
- Added release notes.
- Updated the package to match the new OwlDomain style.
- Updated the license to 1.0.2 (wording tweaks).
- Add enum extensions for checking whether an enum value is defined.
- Add throw helpers to replace OwlDomain.Common.Throw.
- Add guard to replace OwlDomain.Common.Throw.Guards.
- Enum guards (IsDefined).
- Null guards (IsNull).
- Comparison guards (LessThan/GreaterThan/IsBetween).