Biostatistics.ImportClient 0.61.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Biostatistics.ImportClient --version 0.61.0
NuGet\Install-Package Biostatistics.ImportClient -Version 0.61.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="Biostatistics.ImportClient" Version="0.61.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Biostatistics.ImportClient --version 0.61.0
#r "nuget: Biostatistics.ImportClient, 0.61.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.
// Install Biostatistics.ImportClient as a Cake Addin
#addin nuget:?package=Biostatistics.ImportClient&version=0.61.0

// Install Biostatistics.ImportClient as a Cake Tool
#tool nuget:?package=Biostatistics.ImportClient&version=0.61.0

Biostatistics

EF Core Commands

Drop Database

dotnet ef database drop --project src/Biostatistics.Infrastructure

Compile Models

dotnet ef dbcontext optimize -c BiostatisticsContext -o ../Biostatistics.Infrastructure/Database/CompiledModels -n Biostatistics.Infrastructure.Database.CompileModels --project src/Biostatistics.Infrastructure

Add Migrations

dotnet ef migrations add <migrationName> --project src/Biostatistics.Infrastructure

Remove Migrations

dotnet ef migrations remove --project src/Biostatistics.Infrastructure

How to Add a Data Source

1. Add Data Source

To add a new data source, follow these steps:

  1. Open the "DataSource.json" file located in the "SeedData/Data" directory within the "Biostatistics.Seeder" project.
  2. Replace <guid>, <nameDataSource>, and <DateTimeInUtcFormat> with appropriate values in the JSON structure:
{
  "DataSourceId": "<guid>",
  "Name": "<nameDataSource>",
  "DataToggle": false,
  "RecordCount": 0,
  "LastUpdated": null,
  "OriginTimeZone": "America/Puerto_Rico",
  "CreatedAt": "<DateTimeInUtcFormat>"
}

2. Add Model

In the "Biostatistics.Domain" project, create a new model with its respective properties using the following steps:

  1. Create a new directory to contain the model.
  2. Design the model class with necessary properties. Ensure mandatory properties such as "Id" and "DataToggle" are included:
public sealed class ModelName
{
    public long Id { get; set; } // Mandatory property
    // Insert other properties
    public bool DataToggle { get; set; } // Mandatory property
}

3. Add ConfigurationModel

In the "Biostatistics.Infrastructure" project, within the "Database/Configurations" directory, add a configuration class for the previously created model using these steps:

  1. Create a class named ModelNameConfiguration implementing IEntityTypeConfiguration<ModelName>.
  2. Configure the model properties and indexes in the Configure method:
public class ModelNameConfiguration : IEntityTypeConfiguration<ModelName>
{
    public void Configure(EntityTypeBuilder<ModelName> entity)
    {
        entity.ToTable("ModelName", "SchemaName");

        entity.HasKey(e => e.Id);

        entity.HasIndex(e => e.DataToggle)
            .HasDatabaseName("ModelName_data_toggle_idx");

        // Add other indexes for other properties
    }
}

4. Add Configuration to the Database Context

Navigate to "BiostatisticsContext.cs" within the "Biostatistics.Infrastructure" project and include the following code snippet inside the class:

public sealed class BiostatisticsContext : DbContext
{
    public BiostatisticsContext(DbContextOptions<BiostatisticsContext> options)
        : base(options) {}

    public DbSet<ModelName> ModelName => Set<ModelName>(); // Add this command
    //... other code
}

In the OnModelCreating method within "BiostatisticsContext.cs", incorporate the configuration for the new model:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    // other configurations
    modelBuilder.ApplyConfiguration(new ModelNameConfiguration()); // Add this command
}

5. Add Migration

To generate a migration for the newly created model, execute the following command in the terminal:

dotnet ef migrations add <migrationName> --project src/Biostatistics.Infrastructure

Replace <migrationName> with an appropriate name for your migration.

6. Run Compiled Models

Run the compiled models

These steps will assimilate the new model configuration into the database context, create a migration, and execute the compiled models. Replace <ModelName> with your model's actual name.

7. Add ImportClient Dto

Within the "Biostatistics.ImportClient" project, generate a new record representing the previously added model, for instance:

public readonly record struct ModelNameImportDto
( 
  // Model properties
);

8. Add Function to Upload Data Source

In the "BiostatisticsImportClient.cs" file, implement the subsequent method:

public async Task<ImportResultDto> UploadDataSource(IAsyncEnumerable<ModelNameImportDto> dataList)
{
    return await UploadDataToSource(nameof(ModelNameImportDto), dataList);
}

Similarly, add the function declaration in the "BiostatisticsImportClient.cs":

Task<ImportResultDto> UploadDataSource(IAsyncEnumerable<ModelNameImportDto> dataList);

9. Update NuGet Package

Bump new project version and create a Release. This will kick off the CI/CD to publish new versions of the project Nuget package.

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. 
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
0.81.0 105 4/18/2024
0.80.0 94 4/16/2024
0.79.0 121 4/12/2024
0.78.4 83 4/11/2024
0.78.3 95 4/11/2024
0.78.2 80 4/11/2024
0.78.1 82 4/10/2024
0.78.0 77 4/10/2024
0.77.0 72 4/8/2024
0.76.0 107 4/8/2024
0.75.0 71 4/6/2024
0.74.0 87 4/5/2024
0.73.0 104 4/3/2024
0.72.1 70 4/3/2024
0.72.0 63 4/3/2024
0.71.0 88 4/3/2024
0.70.0 65 4/3/2024
0.69.0 82 4/2/2024
0.68.1 81 4/1/2024
0.68.0 90 4/1/2024
0.67.0 76 4/1/2024
0.66.0 91 3/30/2024
0.65.0 80 3/29/2024
0.64.0 76 3/29/2024
0.63.0 74 3/29/2024
0.62.0 63 3/29/2024
0.61.0 76 3/28/2024
0.60.0 87 3/27/2024
0.59.0 94 3/27/2024
0.58.0 112 3/25/2024
0.57.1 85 3/25/2024
0.57.0 76 3/25/2024
0.56.0 103 3/25/2024
0.55.0 80 3/24/2024
0.54.1 116 3/21/2024
0.54.0 83 3/20/2024
0.53.0 88 3/19/2024
0.52.0 102 3/18/2024
0.50.0 208 3/7/2024
0.49.1 95 3/7/2024
0.49.0 111 3/7/2024
0.48.0 90 3/3/2024
0.47.2 83 3/3/2024
0.47.1 81 3/3/2024
0.47.0 80 3/3/2024
0.46.1 148 2/24/2024
0.46.0 78 2/24/2024
0.45.0 377 1/12/2024
0.44.3 378 12/20/2023
0.44.2 96 12/20/2023
0.44.1 89 12/20/2023
0.44.0 83 12/20/2023
0.43.0 378 12/1/2023
0.42.1 109 11/29/2023
0.42.0 95 11/29/2023
0.41.0 94 11/29/2023
0.40.0 444 10/13/2023
0.39.0 119 10/13/2023
0.38.0 363 9/22/2023
0.37.0 242 9/14/2023
0.36.2 110 9/14/2023
0.36.1 104 9/14/2023
0.36.0 131 9/14/2023
0.35.0 253 9/1/2023
0.34.0 180 8/25/2023
0.33.0 203 8/11/2023
0.32.0 140 8/9/2023
0.31.0 169 7/12/2023
0.30.0 126 7/12/2023
0.29.0 137 7/12/2023
0.28.0 366 5/24/2023
0.27.0 143 5/22/2023
0.26.0 129 5/20/2023
0.25.0 222 5/1/2023
0.24.0 113 5/1/2023
0.23.0 185 4/27/2023
0.22.0 126 4/27/2023
0.21.0 142 4/26/2023
0.20.0 130 4/25/2023
0.19.0 129 4/25/2023
0.18.0 142 4/21/2023
0.17.0 137 4/21/2023
0.16.0 321 3/27/2023
0.15.0 175 3/25/2023
0.14.0 181 3/25/2023
0.12.0 529 3/2/2023
0.11.0 678 1/31/2023
0.10.0 297 1/26/2023
0.9.0 512 1/5/2023
0.8.0 271 1/4/2023
0.7.0 271 1/4/2023
0.6.0 264 1/4/2023
0.5.0 275 1/4/2023
0.4.0 264 1/4/2023
0.3.0 267 1/4/2023
0.2.0 273 1/4/2023
0.1.0 288 1/3/2023