.NET 5.0 .NET Core 3.1
dotnet tool install --global Dacpac.Tool --version
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local Dacpac.Tool --version
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Dacpac.Tool&version=
nuke :add-package Dacpac.Tool --version

# How use

## Use .NetCore tool for publish .dacpac file

### What's .dacpac
A data-tier application (DAC) is a logical database management entity that defines all SQL Server objects - such as tables, views, and instance objects - associated with a user's database. It is a self-contained unit of SQL Server database deployment that enables data-tier developers and DBAs to package SQL Server objects into a portable artifact called a DAC package, or .dacpac file. <sup>[See more](https://docs.microsoft.com/en-us/sql/relational-databases/data-tier-applications/data-tier-applications?view=sql-server-2017)</sup>

### Requirements

1. .NET Core 2.1+ runtime installed

### Publish .dacpac with .Net tool

####  Install the Dacpac.Tool package

dotnet tool install --global Dacpac.Tool

#### Run tool only with the required parameters

1. Use case   
Multi tenant database, your have same schema for multiple client on database server

* Windows autentication (SSPI)

dotnet dacpac publish --dacpath=C:\artifact\db\ --server=mydatabase.server.contoso.com --databasenames='client1;client2;client3;client4'
* Specific User authentication

dotnet dacpac publish --dacpath=C:\artifact\db\ --server=mydatabase.server.contoso.com --databasenames='client1;client2;client3;client4' --userId=useWithPersmissionForUpdate --password=123455


* Parameters    

|dacpath| Directory where the dacpac file is stored| Directory that the tool is running|
|databasenames | The names of databases that need to be updated|It's requerid not have default|
|namenattern|Pattern for search file|*.dacpac|
|UseSspi|Indicates that the windows user should be used|true
|userId|Database user <sub>Need permissions for schema change</sub>|carioca|
|password| The password from 'userid' | IFromBrazilian|

[See all parameters](https://docs.microsoft.com/en-us/dotnet/api/microsoft.sqlserver.dac.dacdeployoptions?redirectedfrom=MSDN&view=sql-dacfx-140.3881.1)

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp3.1
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated 4,685 8/18/2021 1,186 12/29/2020 291 12/29/2020 438 11/13/2020
1.0.388 493 3/13/2019
1.0.386 584 3/12/2019
1.0.375 697 2/9/2019
1.0.373 673 1/27/2019