{"id":24401685,"url":"https://github.com/Devgametools/entity_framework","last_synced_at":"2025-09-30T08:31:36.196Z","repository":{"id":272784949,"uuid":"917157722","full_name":"Devgametools/entity_framework","owner":"Devgametools","description":"ENTITY FRAMEWORK PRACTICE (C# - .NET)","archived":false,"fork":false,"pushed_at":"2025-01-21T04:36:33.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-23T06:45:26.407Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Devgametools.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-15T13:18:01.000Z","updated_at":"2025-01-21T04:36:36.000Z","dependencies_parsed_at":"2025-01-16T16:55:46.571Z","dependency_job_id":"f1dcd104-ea8f-4145-aad5-e29ba06b8f07","html_url":"https://github.com/Devgametools/entity_framework","commit_stats":null,"previous_names":["robertbass/entity_framework","devgametools/entity_framework"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Devgametools/entity_framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devgametools%2Fentity_framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devgametools%2Fentity_framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devgametools%2Fentity_framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devgametools%2Fentity_framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Devgametools","download_url":"https://codeload.github.com/Devgametools/entity_framework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devgametools%2Fentity_framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277652868,"owners_count":25854378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-30T02:00:09.208Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-20T00:46:02.388Z","updated_at":"2025-09-30T08:31:36.190Z","avatar_url":"https://github.com/Devgametools.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Entity Framework Core\n\n## Create a new project\n```bash\n# Create a new project in the current directory\ndotnet new web\n```\n\n## Add Entity Framework Core and Utils\n```bash\n# Add Entity Framework Core\ndotnet add package Microsoft.EntityFrameworkCore\ndotnet add package Microsoft.EntityFrameworkCore.InMemory\ndotnet add package Npgsql.EntityFrameworkCore.PostgreSQL\n```\n\n## Install PostgreSQL\n\n### Install PostgreSQL on Windows\n\n1. Download the installer from [here](https://www.enterprisedb.com/downloads/postgres-postgresql-downloads)\n2. Run the installer and follow the instructions\n3. Open the PostgreSQL command line tool by searching for it in the Start menu\n4. Create a new user by running the following command:\n\n```bash\ncreateuser -P -s -e username\n```\n\n### Install PostgreSQL on Linux\n\n1. Install PostgreSQL by running the following command:\n\n```bash\nsudo apt-get install postgresql\n```\n\n2. Create a new user by running the following command:\n\n```bash\nsudo -u postgres createuser -P -s -e username\n```\n\n4. Exit the PostgreSQL command line tool by pressing Ctrl + D\n\n\n## Install dotnet-ef\n\n1. Install dotnet-ef by running the following command:\n\n```bash\ndotnet tool install --global dotnet-ef\ndotnet add package Microsoft.EntityFrameworkCore.Design --version 9.0.1\n\n```\n\n2. Verify the installation by running the following command:\n\n```bash\ndotnet ef --version\n```\n\n3. Create a new migration by running the following command:\n\n```bash\ndotnet ef migrations add InitialCreate --context TaskContext\n```\n\n4. Apply the migration by running the following command:\n\n```bash\ndotnet ef database update\n```\n\n5. Run the application by running the following command:\n\n```bash\ndotnet run\n```\n\n\n# Some useful commands for PostgreSQL prompt\n\n## Create a new database\n```bash\ncreatedb -U username DatabaseName\n```\n\n## Create a new user\n```bash\ncreateuser -P -s -e username\n```\n\n## Create a new table\n```bash\nCREATE TABLE Categories (\n    CategoryId UUID PRIMARY KEY,\n    Name VARCHAR(150) NOT NULL,\n    Description VARCHAR(500)\n);\n```\n## Command Prompt of PostgreSQL\n```bash\npsql -U username -d DatabaseName\n```\n\n## Create a new column\n```bash\nALTER TABLE Categories ADD COLUMN Description VARCHAR(500);\n```\n\n## Delete a column\n```bash\nALTER TABLE Categories DROP COLUMN Description;\n```\n\n## Delete a table\n```bash\nDROP TABLE Categories;\n```\n\n## Delete a database\n```bash\ndropdb -U username DatabaseName\n```\n\n## Delete a user\n```bash\ndropuser -U username username\n```\n\n## List all databases\n```bash\n\\l\n```\n\n## List all tables\n```bash\n\\dt\n```\n\n## List all columns\n```bash\n\\d Categories\n```\n\n## List only the column names\n```bash\nSELECT column_name \nFROM information_schema.columns \nWHERE table_schema = 'public' \nAND table_name = 'Name_of_the_table';\n```\n\n## List all rows\n```bash\nSELECT * FROM Categories;\n```\n\n## Insert a row\n```bash\nINSERT INTO Categories (Name, Description) VALUES ('Category Name', 'Category Description');\n```\n\n## Update a row\n```bash\nUPDATE Categories SET Name = 'New Category Name' WHERE CategoryId = '00000000-0000-0000-0000-000000000000';\n```\n\n## Delete a row\n```bash\nDELETE FROM Categories WHERE CategoryId = '00000000-0000-0000-0000-000000000000';\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDevgametools%2Fentity_framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDevgametools%2Fentity_framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDevgametools%2Fentity_framework/lists"}