Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karenpayneoregon/ef-core-findall-cs
EF Core Find(All) method
https://github.com/karenpayneoregon/ef-core-findall-cs
csharp entity-framework-core sql-server
Last synced: 3 days ago
JSON representation
EF Core Find(All) method
- Host: GitHub
- URL: https://github.com/karenpayneoregon/ef-core-findall-cs
- Owner: karenpayneoregon
- Created: 2020-04-30T20:56:16.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-06T17:25:13.000Z (over 3 years ago)
- Last Synced: 2024-11-30T19:25:33.412Z (2 months ago)
- Topics: csharp, entity-framework-core, sql-server
- Language: C#
- Homepage:
- Size: 303 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# About
This Visual Studio solution was originally for a Microsoft article [Entity Framework Core Find all by primary key (C#)](https://social.technet.microsoft.com/wiki/contents/articles/53841.entity-framework-core-find-all-by-primary-key-c.aspx).
Currently has a class and form project to demonstrate code for the above article along with two new projects to show simple editing a record using a newer version of Entity Framework Core and C#9.
## Requires
The following
- Visual Studio [2019](https://visualstudio.microsoft.com/vs/)
- [SSMS](https://docs.microsoft.com/en-us/sql/ssms/sql-server-management-studio-ssms?view=sql-server-ver15)
- [.NET Core 5](https://dotnet.microsoft.com/download)## Pluralsight resources
- [C# Fundamentals](https://app.pluralsight.com/library/courses/csharp-fundamentals-dev/table-of-contents)
- [Entity Framework Core: Getting Started](https://app.pluralsight.com/library/courses/entity-framework-core-get-started/table-of-contents)
- [Preparing Your Move to Entity Framework Core 5](https://app.pluralsight.com/library/courses/preparing-your-move-entity-framework-core-5-webinar/table-of-contents)## First steps
- Clone this repository, see **Clone repository** below. Best using [GitDesktop](https://desktop.github.com/) while using **Download ZIP** usually sets `mark of the web` and if so Visual Studio will not compile, use PowerShell code found [here](#Unblock-Files-in-Folder).
- Using [SSMS](https://en.wikipedia.org/wiki/SQL_Server_Management_Studio) (SQL-Server Management Studio)
- Create a new database named `NorthWindAzureForInserts`.
- Once created run the script in [NorthWindScript.sql](https://github.com/karenpayneoregon/ef-core-findall-cs/blob/master/SampleLibrary/NorthWindScript.sql)### Clone repository
![img](assets/Clone.png)
Screenshot for original code sample
![img](assets/find.png)
Screenshot for CRUD example
![img](assets/simple.png)
:red_circle: Normally desktop application would not be used, instead unit test projects so that the code may be used in a desktop or web application. Since many developers avoid unit test this is the reason for desktop projects.
## Unblock Files in Folder
Using PowerShell to unblock mark of the web in a PowerShell window. Replace `[directory path]` with the root folder to run on.
```ps
dir -Path [directory path] -Recurse | Unblock-File
Get-ChildItem -Path '[directory path]' -Recurse | Unblock-File
```