Roost.RoostCore.ServiceCharges 1.0.11

dotnet add package Roost.RoostCore.ServiceCharges --version 1.0.11
                    
NuGet\Install-Package Roost.RoostCore.ServiceCharges -Version 1.0.11
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Roost.RoostCore.ServiceCharges" Version="1.0.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Roost.RoostCore.ServiceCharges" Version="1.0.11" />
                    
Directory.Packages.props
<PackageReference Include="Roost.RoostCore.ServiceCharges" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Roost.RoostCore.ServiceCharges --version 1.0.11
                    
#r "nuget: Roost.RoostCore.ServiceCharges, 1.0.11"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Roost.RoostCore.ServiceCharges@1.0.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Roost.RoostCore.ServiceCharges&version=1.0.11
                    
Install as a Cake Addin
#tool nuget:?package=Roost.RoostCore.ServiceCharges&version=1.0.11
                    
Install as a Cake Tool

RoostCore Nuget Library

The RoostCore nuget library contains models, interfaces and helpers for use with Roost software development.

Models

ExpireTime

public class ExpireTime    
{
    public int Hours { get; set; }
    public int Minutes { get; set; }
    public int Seconds { get; set; }
}

HttpClientInfo

The HttpClientInfo can be used to store information about the remote client (remote user) and can be used for auditing purposes.

public class HttpClientInfo
{
    public string UserId { get; set; } = string.Empty;
    public string Username { get; set; } = string.Empty;
    public string OrganisationId { get; set; } = string.Empty;
    public string LocalIpAddress { get; set; } = string.Empty;
    public string RemoteIPAddress { get; set; } = string.Empty;
    public string ClientMachine { get; set; } = string.Empty;
}

IdList

The IdList is a list of Guids that can be used to do multiple deletes in EF Core.

public class IdList
{
    public List<Guid> Ids { get; set; }
}

DeleteIdList

Contains the organisation id and a list of Guids (IdList) of the items to be deleted.

public class DeleteIdList
{
    public Guid OrganisationId { get; set; }
    public IdList Ids { get; set; } = new IdList();
}

MapLngLat

The MapLngLat model is used to store map positions.

public class MapLngLat
{
    public MapLngLat() { }
    public MapLngLat(float lat, float lng)
    {
        Lat = lat;
        Lng = lng;
    }
    public float Lat { get; set; } = 0f;
    public float Lng { get; set; } = 0f;
}

VersionInfo

Version info is aligned to semantic versioning

public class VersionInfo
{
    public Guid Id { get; set; }
    public int Major { get; set; }
    public int Minor { get; set; }
    public int Patch { get; set; }
    public int Revision { get; set; }
}

VersionInfoDto

Version info is aligned to semantic versioning and extends VersionInfo to return a string version of the version number(s).

public class VersionInfoDto
{
    public Guid Id { get; set; }
    public int Major { get; set; }
    public int Minor { get; set; }
    public int Patch { get; set; }
    public int Revision { get; set; }
    public string Version
    {
        get
        {
            return $"{Major}.{Minor}.{Patch}.{Revision}";
        }
    }
}

ServiceBusMessage

Used to transfer objects via azure service bus. This message is not strongly typed.

public class ServiceBusMessage
{
    public string Action { get; set; } = null!;
    public string EntityType { get; set; } = null!;
    public string MessageBodyJson { get; set; } = null!;
}

ServiceBusMessageDto

Used to transfer objects via azure service bus. This message is strongly typed.

public class ServiceBusMessageDto<T>
{
    public string Action { get; set; } = null!;
    public string EntityType { get; set; } = typeof(T).AssemblyQualifiedName ?? "";
    public T? Entity { get; set; }
    public string EntityJson { get; set; } = null!;
    public string EntityTypeShort { get; }
}

ServiceBusMessageRaw

Used to transfer objects via azure service bus. This message is in raw json format only and is not strongly typed.

public class ServiceBusMessageRaw
{
    public string Action { get; set; } = null!;
    public string EntityType { get; set; } = null!;
    public object Entity { get; set; } = null!;
    public string EntityJson { get; set; } = null!;
    public string EntityTypeShort { get; }
}

ServiceBusDeleteMessageDto

Used to transfer delete requests via azure service bus.

public class ServiceBusDeleteMessageDto
{
    public string EntityType { get; set; } = null!;
    public string OrganisationId { get; set; } = null!;
    public string IdsListJson { get; set; } = null!;
}

Interfaces

IAudit

IAudit can be used to enforce auditing withing models

public interface IAudit
{
    Guid AuditId { get; set; }
    DateTime AuditDate { get; set; }
    string AuditIdentityId { get; set; }
    string AuditUsername { get; set; }
    string AuditMachine { get; set; }
    [MaxLength(39)]
    string AuditLocalIpAddress { get; set; }
    string AuditRemoteIpAddress { get; set; }
    string AuditAction { get; set; }
}

IEntity

IEntity is used to enforce a standard structure to objects. When used with EF Core this is useful to make sure all objects are related to an organisation and have the correct standard properties

public interface IEntity
{
    #region " Entity base "

    Guid Id { get; set; }
    Guid OrganisationId { get; set; }
    bool IsDeleted { get; set; }
    DateTime DateCreated { get; set; }
    DateTime LastModified { get; set; }

    #endregion
}

IFluentModel

Used in EF Core to create models with custom attributes

public interface IFluentModel
{
    ModelBuilder Build(ModelBuilder modelBuilder);
}

IRedisConfig

public interface IRedisConfig
{
    bool UseRedis { get; set; }
    string RedisCache { get; set; }
    string InstanceNamePrefix { get; set; }

    ExpireTime AbsoluteExpireTime { get; set; }
    ExpireTime UnusedExpireTime { get; set; }
}

ISeeder

Used in the latest EF Core (version 9 and later) seeding

public interface ISeeder
{
    void Seed(DbContext context, DateTime timestamp);
    Task SeedAsync(DbContext context, DateTime timestamp, CancellationToken cancellationToken);
}

IUtilities

Used in the Utilities helper

public interface IUtilities
{
    List<Guid> ConvertNullableGuidList(IEnumerable<Guid?> guidList);
    IEnumerable<Guid?> ConvertStringToNullableGuidList(string guidList);
    IEnumerable<Guid?> ConvertGuidListToNullableGuidList(IEnumerable<Guid> guidList);
}

Core

BaseController

Inherits from ControllerBase for use to extend api controllers with additional functionality

public string OrganisationId

Gets the current organisation id from the list of claims for the authenticated user

public Guid OrganisationIdGuid

Gets the current organisation id from the list of claims for the authenticated user

public string UserId

Gets the current user id from the list of claims for the authenticated user

public string Username

Returns the username for the context of the current controller

public HttpClientInfo ClientInfo

Returns an HttpClientInfo model populated using info from the context of the current controller

Helpers

Useful classes that provide various functionality

BuilderExtensions

Makes an entity read only in Entity Framework when building it's model.

Usage: modelBuilder.Entity<CustomEntityName>().IsReadOnly();

DistributedCacheHelpers

Helpers for use with Redis caching

public static async Task SetRecordAsync<T>(this IDistributedCache cache, string recordId, T data, TimeSpan? absoluteExpireTime = null, TimeSpan? unusedExpireTime = null)

public static async Task<T> GetRecordAsync<T>(this IDistributedCache cache, string recordId)

Utilities

public List<Guid> ConvertNullableGuidList(IEnumerable<Guid?> guidList)

Converts a list of nullable guids to a standard (non-nullable) list of guids

public IEnumerable<Guid?> ConvertStringToNullableGuidList(string guidList)

Converts a string containing a comma separated list of guids to a list of nullable guids

public IEnumerable<Guid?> ConvertGuidListToNullableGuidList(IEnumerable<Guid> guidList)

Converts a list of guids to a list of nullable guids

Product 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.11 407 6/12/2025
1.0.10 389 6/12/2025
1.0.9 378 6/12/2025
1.0.8 282 6/8/2025
1.0.7 281 6/8/2025
1.0.6 199 6/7/2025
1.0.5 198 6/7/2025
1.0.4 219 5/29/2025
1.0.3 260 4/20/2025
1.0.2 180 4/19/2025
1.0.1 180 4/19/2025
1.0.0 171 4/19/2025