MPOSAirDataCleanUpSample 0.6.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package MPOSAirDataCleanUpSample --version 0.6.0
                    
NuGet\Install-Package MPOSAirDataCleanUpSample -Version 0.6.0
                    
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="MPOSAirDataCleanUpSample" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MPOSAirDataCleanUpSample" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="MPOSAirDataCleanUpSample" />
                    
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 MPOSAirDataCleanUpSample --version 0.6.0
                    
#r "nuget: MPOSAirDataCleanUpSample, 0.6.0"
                    
#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.
#addin nuget:?package=MPOSAirDataCleanUpSample&version=0.6.0
                    
Install MPOSAirDataCleanUpSample as a Cake Addin
#tool nuget:?package=MPOSAirDataCleanUpSample&version=0.6.0
                    
Install MPOSAirDataCleanUpSample as a Cake Tool

Data clean up-project for MPOS Air.

To be used as a NuGet once development is finished for v1.0.0.

To add the functionality, add the following line to your configured services:

   serviceCollection.AddDataCleanUpServices();

This call adds the CleanUpService functionality as well as the internal logging used. The logger output is being shown into the Console.

The following way of usage is enforced: USAGE:

  1. Add DataCleanings table to the database.

The nuget uses an internal entity called DataCleaning to keep track of the data that has been cleaned. The properties are as follow:

  public class DataCleaning : Entity<int>
   {
       public DataCleaning() { }

       public DataCleaning(CleanUpPeriod period, string entity, bool cleanUpStarted)
       {
           CleanUpPeriod = period;
           Entity = entity;
           CleanUpStarted = cleanUpStarted;
       }

       public CleanUpPeriod CleanUpPeriod { get; set; }

       public DateTime? LastCleanUpTime { get; set; }

       public string Entity { get; set; }

       public bool IsCleaned { get; set; } 

       public bool CleanUpStarted { get; set; }

       public bool CleanUpEnded { get; set; }
   } 

CAUTION: Make sure the table exists, otherwise, the nuget throws the error into the console and the cleaning will not take place.

  1. Setup the services in Startup.cs Inject your context into the clean up service and add entities as you please.

To add the functionality, add the following lines to your configured services:

   cleanUpService.WithContext(context)
                   .ForEntity(typeof(Entity1), (x) => 
                  {
                        var convertedType = x as Entity1;
                        return convertedType.Amount > 900;
                  })
                  .WithStartTime(typeof(Entity1), "15:45:00")
                  .WithPeriod(CleanUpPeriod.Daily)
                  .InitializeCleanUp();

The ForEntity method requires a Type object that should derive from IEntity, found inside MposAirDataContracts nuget package, and a filter. You can chain as many entities as you like, however CleanUpPeriod will be set for ALL the entities defined, and you CANNOT add the same entity type more than once, otherwise an exception will be thrown for this at runtime (if this happens, check the console logs).

To add another entity, do it after the call for WithStartTime().

   cleanUpService.WithContext(context)
                  .ForEntity(typeof(Entity1), (x) => 
                  {
                        var convertedType = x as Entity1;
                        return convertedType.Amount > 900;
                  })
                  .WithStartTime(typeof(Entity1), "15:45:00")
                  .ForEntity(typeof(Entity2), (x) => 
                  {
                        var convertedType = x as Entity2;
                        return convertedType.Amount > 900;
                  })
                  .WithStartTime(typeof(Entity2), "11:30:00")
                  .WithPeriod(CleanUpPeriod.Daily)
                  .InitializeCleanUp();

CAUTION: any and all exceptions are captured and shown into the console output of the application that uses the nuget.

At this point, the default values for the CleanUpPeriod object are:

  • Daily
  • Weekly - every Sunday
  • Monthly - the 1st of every month
  • Yearly - the last day of the year
Product 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 netcoreapp3.1 is compatible. 
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