Biostatistics.ImportClient
0.49.0
See the version list below for details.
dotnet add package Biostatistics.ImportClient --version 0.49.0
NuGet\Install-Package Biostatistics.ImportClient -Version 0.49.0
<PackageReference Include="Biostatistics.ImportClient" Version="0.49.0" />
paket add Biostatistics.ImportClient --version 0.49.0
#r "nuget: Biostatistics.ImportClient, 0.49.0"
// Install Biostatistics.ImportClient as a Cake Addin
#addin nuget:?package=Biostatistics.ImportClient&version=0.49.0
// Install Biostatistics.ImportClient as a Cake Tool
#tool nuget:?package=Biostatistics.ImportClient&version=0.49.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:
- Open the "DataSource.json" file located in the "SeedData/Data" directory within the "Biostatistics.Seeder" project.
- 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:
- Create a new directory to contain the model.
- 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:
- Create a class named
ModelNameConfiguration
implementingIEntityTypeConfiguration<ModelName>
. - 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 | Versions 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. |
-
net8.0
- Azure.Storage.Blobs (>= 12.19.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- protobuf-net (>= 3.2.30)
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.84.1 | 293 | 6/10/2024 |
0.84.0 | 57 | 6/10/2024 |
0.83.1 | 122 | 6/4/2024 |
0.83.0 | 76 | 5/29/2024 |
0.82.0 | 200 | 5/26/2024 |
0.81.0 | 244 | 4/18/2024 |
0.80.0 | 105 | 4/16/2024 |
0.79.0 | 132 | 4/12/2024 |
0.78.4 | 91 | 4/11/2024 |
0.78.3 | 102 | 4/11/2024 |
0.78.2 | 87 | 4/11/2024 |
0.78.1 | 89 | 4/10/2024 |
0.78.0 | 82 | 4/10/2024 |
0.77.0 | 79 | 4/8/2024 |
0.76.0 | 114 | 4/8/2024 |
0.75.0 | 78 | 4/6/2024 |
0.74.0 | 94 | 4/5/2024 |
0.73.0 | 109 | 4/3/2024 |
0.72.1 | 75 | 4/3/2024 |
0.72.0 | 73 | 4/3/2024 |
0.71.0 | 92 | 4/3/2024 |
0.70.0 | 69 | 4/3/2024 |
0.69.0 | 87 | 4/2/2024 |
0.68.1 | 86 | 4/1/2024 |
0.68.0 | 94 | 4/1/2024 |
0.67.0 | 81 | 4/1/2024 |
0.66.0 | 96 | 3/30/2024 |
0.65.0 | 84 | 3/29/2024 |
0.64.0 | 80 | 3/29/2024 |
0.63.0 | 78 | 3/29/2024 |
0.62.0 | 67 | 3/29/2024 |
0.61.0 | 80 | 3/28/2024 |
0.60.0 | 91 | 3/27/2024 |
0.59.0 | 98 | 3/27/2024 |
0.58.0 | 116 | 3/25/2024 |
0.57.1 | 89 | 3/25/2024 |
0.57.0 | 79 | 3/25/2024 |
0.56.0 | 107 | 3/25/2024 |
0.55.0 | 85 | 3/24/2024 |
0.54.1 | 122 | 3/21/2024 |
0.54.0 | 87 | 3/20/2024 |
0.53.0 | 95 | 3/19/2024 |
0.52.0 | 109 | 3/18/2024 |
0.50.0 | 212 | 3/7/2024 |
0.49.1 | 99 | 3/7/2024 |
0.49.0 | 114 | 3/7/2024 |
0.48.0 | 94 | 3/3/2024 |
0.47.2 | 87 | 3/3/2024 |
0.47.1 | 85 | 3/3/2024 |
0.47.0 | 88 | 3/3/2024 |
0.46.1 | 152 | 2/24/2024 |
0.46.0 | 81 | 2/24/2024 |
0.45.0 | 380 | 1/12/2024 |
0.44.3 | 381 | 12/20/2023 |
0.44.2 | 98 | 12/20/2023 |
0.44.1 | 91 | 12/20/2023 |
0.44.0 | 85 | 12/20/2023 |
0.43.0 | 382 | 12/1/2023 |
0.42.1 | 118 | 11/29/2023 |
0.42.0 | 98 | 11/29/2023 |
0.41.0 | 100 | 11/29/2023 |
0.40.0 | 448 | 10/13/2023 |
0.39.0 | 122 | 10/13/2023 |
0.38.0 | 367 | 9/22/2023 |
0.37.0 | 246 | 9/14/2023 |
0.36.2 | 114 | 9/14/2023 |
0.36.1 | 107 | 9/14/2023 |
0.36.0 | 134 | 9/14/2023 |
0.35.0 | 257 | 9/1/2023 |
0.34.0 | 184 | 8/25/2023 |
0.33.0 | 207 | 8/11/2023 |
0.32.0 | 144 | 8/9/2023 |
0.31.0 | 173 | 7/12/2023 |
0.30.0 | 130 | 7/12/2023 |
0.29.0 | 141 | 7/12/2023 |
0.28.0 | 371 | 5/24/2023 |
0.27.0 | 147 | 5/22/2023 |
0.26.0 | 133 | 5/20/2023 |
0.25.0 | 226 | 5/1/2023 |
0.24.0 | 117 | 5/1/2023 |
0.23.0 | 194 | 4/27/2023 |
0.22.0 | 130 | 4/27/2023 |
0.21.0 | 146 | 4/26/2023 |
0.20.0 | 134 | 4/25/2023 |
0.19.0 | 133 | 4/25/2023 |
0.18.0 | 146 | 4/21/2023 |
0.17.0 | 141 | 4/21/2023 |
0.16.0 | 325 | 3/27/2023 |
0.15.0 | 179 | 3/25/2023 |
0.14.0 | 185 | 3/25/2023 |
0.12.0 | 533 | 3/2/2023 |
0.11.0 | 686 | 1/31/2023 |
0.10.0 | 304 | 1/26/2023 |
0.9.0 | 516 | 1/5/2023 |
0.8.0 | 275 | 1/4/2023 |
0.7.0 | 275 | 1/4/2023 |
0.6.0 | 268 | 1/4/2023 |
0.5.0 | 279 | 1/4/2023 |
0.4.0 | 268 | 1/4/2023 |
0.3.0 | 271 | 1/4/2023 |
0.2.0 | 277 | 1/4/2023 |
0.1.0 | 292 | 1/3/2023 |