274b9b8cd1 | ||
---|---|---|
.. | ||
EntityFramework.csproj | ||
HttpTrigger.cs | ||
Models.cs | ||
Program.cs | ||
README.md | ||
host.json | ||
local.settings.sample.json | ||
test.http |
README.md
.NET 5 Entity Framework Sample (Azure Functions)
Setup
- Clone the repo
- Rename
local.settings.sample.json
tolocal.settings.json
and fill in connection strings - Install the dontnet-ef tool:
dotnet tool install --global dotnet-ef
- Set the connection string for migration
$env:SqlConnectionString="Server=tcp:my.database.windows.net,1433;......"
- Create the initial migration
dotnet ef migrations add initial
- Update the database
dotnet ef database update
- Run the function project with
func start
- Call the different operations in the
./test.http
file (file format is for RESTClient in VS Code)