Skip to content

jeffhollan/functions-csharp-entityframeworkcore

Repository files navigation

Interested in .NET 5?

Link to a sample using Entity Framework 5 in Azure Functions: https://github.com/jeffhollan/functions-net5-entityframework

.NET Core Entity Framework and functions

C# Function that uses dependency injection and entity framework core with Azure SQL. A few things of note:

I want to use design-first migration, so I created a IDesignTimeDbContextFactory for the tooling to generate the right DbContext.

I also had to add a post-build step to the .csproj file to make sure the .dll for the project is where the entity framework tooling expected:

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
  <Exec Command="copy /Y &quot;$(TargetDir)bin\$(ProjectName).dll&quot; &quot;$(TargetDir)$(ProjectName).dll&quot;" />
</Target>

About

C# Function that uses dependency injection and entity framework core with Azure SQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages