5

Github GitHub - efcore/EFCore.FSharp: Adds F# design-time support to EF Core

 3 years ago
source link: https://github.com/efcore/EFCore.FSharp
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

EFCore.FSharp

Add F# design time support to EF Core.

For a basic introduction to running code-first migrations, please see the getting started guide.


Builds

NuGet

Package Stable Prerelease EFCore.FSharp


Usage

Install the package from NuGet and follow our Getting Started guide or our full documentation at https://efcore.github.io/EFCore.FSharp

Currently created migrations must be manually added to your solution in the correct order. Although migrations are created with sequential file names so a glob can also be used

<Compile Include="Migrations/*.fs" />

Building

> build.cmd <optional buildtarget> // on windows
$ ./build.sh  <optional buildtarget>// on unix

After building the solution, it will create a NuGet package in the dist folder. This can then be referenced as usual.

Developing

Make sure the following requirements are installed on your system:


Environment Variables

  • CONFIGURATION will set the configuration of the dotnet commands. If not set, it will default to Release.
    • CONFIGURATION=Debug ./build.sh will result in -c additions to commands such as in dotnet build -c Debug
  • GITHUB_TOKEN will be used to upload release notes and Nuget packages to GitHub.
    • Be sure to set this before releasing
  • DISABLE_COVERAGE Will disable running code coverage metrics. AltCover can have severe performance degradation so it's worth disabling when looking to do a quicker feedback loop.
    • DISABLE_COVERAGE=1 ./build.sh

Build Targets

  • Clean - Cleans artifact and temp directories.
  • DotnetRestore - Runs dotnet restore on the solution file.
  • DotnetBuild - Runs dotnet build on the solution file.
  • DotnetTest - Runs dotnet test on the solution file.
  • GenerateCoverageReport - Code coverage is run during DotnetTest and this generates a report via ReportGenerator.
  • WatchTests - Runs dotnet watch with the test projects. Useful for rapid feedback loops.
  • GenerateAssemblyInfo - Generates AssemblyInfo for libraries.
  • DotnetPack - Runs dotnet pack. This includes running Source Link.
  • SourceLinkTest - Runs a Source Link test tool to verify Source Links were properly generated.
  • PublishToNuGet - Publishes the NuGet packages generated in DotnetPack to NuGet via paket push.
  • GitRelease - Creates a commit message with the Release Notes and a git tag via the version in the Release Notes.
  • GitHubRelease - Publishes a GitHub Release with the Release Notes and any NuGet packages.
  • FormatCode - Runs Fantomas on the solution file.
  • BuildDocs - Generates Documentation from docsSrc and the XML Documentation Comments from your libraries in src.
  • WatchDocs - Generates documentation and starts a webserver locally. It will rebuild and hot reload if it detects any changes made to docsSrc files, libraries in src, or the docsTool itself.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK