<commit_before># .NET Core Party EF example

Example solution using .NET Core EF with a split class library for migrations used by a Web application to interact with a Database.

This is intended as an example of implementing and using the [universal person and organisation data model](http://tdan.com/a-universal-person-and-organization-data-model/5014) created by <NAME>. This model allows you to record links to parties regardless of whether they are persons or organisations (or other), a common requirement in business operations dealing with interactions from different types of actors.

## Setup Database

Update the database connection string in `PartyData/appsettings.json`.

In Visual Studio:
1. Open the solution in Visual Studio
2. Open "Package manager console" and select the project "PartyData"
3. Enter the command "Update-Database"

In Powershell/VS Code terminal
1. In the shell navigate to path of the PartyData project
2. Enter the command "dotnet restore"
3. Enter the command "dotnet ef database update"

Powershell/VS Code requires csproj file contains:

```
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.1" />
  </ItemGroup>
```

## Notes

- EF Core currently [doesn't support Table per Type](https://github.com/aspnet/EntityFramework/issues/2266), so avoid Entities that inherit from other Entities, as it will generate large flat tables. Instead model the Entities based on the table structure you intend and create repository/query objects that map/manage those Entities to Business objects that contain and manipulate data from multiple entities.

## Links

- http://www.c-sharpcorner.com/article/crud-operations-in-asp-net-core-using-entity-framework-core-code-first/
- https://www.benday.com/2017/02/17/ef-core-migrations-without-hard-coding-a-connection-string-using-idbcontextfactory/<commit_msg>updated readme for travis<commit_after># .NET Core Party EF example

![BuildStatus](https://travis-ci.org/stevenalexander/NetCorePartyEfExample.svg?branch=master)

Example solution using .NET Core EF with a split class library for migrations used by a Web application to interact with a Database.

This is intended as an example of implementing and using the [universal person and organisation data model](http://tdan.com/a-universal-person-and-organization-data-model/5014) created by <NAME>. This model allows you to record links to parties regardless of whether they are persons or organisations (or other), a common requirement in business operations dealing with interactions from different types of actors.

## Setup Database

Update the database connection string in `PartyData/appsettings.json`.

In Visual Studio:
1. Open the solution in Visual Studio
2. Open "Package manager console" and select the project "PartyData"
3. Enter the command "Update-Database"

In Powershell/VS Code terminal
1. In the shell navigate to path of the PartyData project
2. Enter the command "dotnet restore"
3. Enter the command "dotnet ef database update"

Powershell/VS Code requires csproj file contains:

```
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.1" />
  </ItemGroup>
```

## Notes

- EF Core currently [doesn't support Table per Type](https://github.com/aspnet/EntityFramework/issues/2266), so avoid Entities that inherit from other Entities, as it will generate large flat tables. Instead model the Entities based on the table structure you intend and create repository/query objects that map/manage those Entities to Business objects that contain and manipulate data from multiple entities.
- Travis CI supports [csharp net core builds](https://docs.travis-ci.com/user/languages/csharp/), but the dotnet framework version property does not directly match the framework name, i.e. .NETCoreApp 1.1 is `dotnet: 1.0.1`.

## Links

- http://www.c-sharpcorner.com/article/crud-operations-in-asp-net-core-using-entity-framework-core-code-first/
- https://www.benday.com/2017/02/17/ef-core-migrations-without-hard-coding-a-connection-string-using-idbcontextfactory/
{'fraction_non_alphanumeric': 0.08264462809917356, 'fraction_numerical': 0.013368983957219251, 'mean_word_length': 4.771388499298737, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4751581', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1071, 'n_words': 455}