Skip to content

Latest commit

 

History

History
94 lines (71 loc) · 6.12 KB

README.md

File metadata and controls

94 lines (71 loc) · 6.12 KB

ASP.NET 6 Core application made with C#, Entity Framework Core, and SQL Server.

PROJECT DEPENDENCIES

Include this in the Visual Studio installation:

  • ASP.NET and web development.
  • Azure development.
  • .NET desktop development.

PROJECT SETUP

  • When creating a project, select: ASP.NET Core Web App (Model-View-Controller) template.
  • Select .NET 6 framework.

DB SETUP

  • While in Visual Studio, navigate to the dependencies folder and right click
  • In Manage NuGet packages, search and install Microsoft.EntityFrameworkCore.SqlServer.
  • Also install Microsoft.EntityFrameworkCore.Tools.
  • Create a 'Data' folder inside the main directory.
  • Create a class file inside that folder and name it in this format:" YourProjectDbContext ".
  • This class inherits from the DbContext class from Microsoft.EntityFrameworkCore.
  • Inside the Models directory, create a Domain folder.
  • Inside the Domain folder, create a class, named based on your DB table.
  • Populate the class with your column names.
  • Navigate to the main program: 'Program.cs'.
  • Add the code:"
builder.Services.AddDbContext<YourAppDbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("YourAppConnectionString")));

", which are imported from the Data folder and the Microsoft.EntityFrameworkCore.

  • Go to 'appsettings.json' and create a connection string property below the AllowedHosts.
  • Code:"
"ConnectionStrings": { "YourAppConnectionString": "server=YourServerName;database=YourAppDb;Trusted_connection=true;TrustServerCertificate=True" }

".

  • In the navigation bar, go to Tools -> NuGet Package Manager -> Package Manager Console.
  • Run the command:" Add-Migration "Initial Migration" " and then press enter.
  • Run another command:" Update-Database " and press enter.
  • Refresh your Databases folder in the Microsoft SQL Server Management Studio.

AND YOU ARE SET!

  • Make sure you are importing (using) the packages/class files you are implementing in your code.

=================================================

ASP.NET Core

.NET Foundation MIT License Help Wanted Good First Issues Discord

ASP.NET Core is an open-source and cross-platform framework for building modern cloud-based internet-connected applications, such as web apps, IoT apps, and mobile backends. ASP.NET Core apps run on .NET, a free, cross-platform, and open-source application runtime. It was architected to provide an optimized development framework for apps that are deployed to the cloud or run on-premises. It consists of modular components with minimal overhead, so you retain flexibility while constructing your solutions. You can develop and run your ASP.NET Core apps cross-platform on Windows, Mac, and Linux. Learn more about ASP.NET Core.

Get started

Follow the Getting Started instructions.

Also check out the .NET Homepage for released versions of .NET, getting started guides, and learning resources.

See the Triage Process document for more information on how we handle incoming issues.

How to engage, contribute, and give feedback

Some of the best ways to contribute are to try things out, file issues, join in design conversations, and make pull-requests.

Reporting security issues and bugs

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

Related projects

These are some other repos for related projects:

Code of conduct

See CODE-OF-CONDUCT