Corey Brooks

Corey Brooks

1656386666

How to Adds an API to Your Website with ASP.NET Core

Learn C# with CSharpFritz - Add an API to your Website with C#

Fritz has built a website to manage your collection, but how can we open up the website with an API to allow other integrations?  In this session, Fritz adds an API to our website using ASP.NET Core

#aspnetcore #api #dotnet #csharp #webdev 

How to Adds an API to Your Website with ASP.NET Core
Verdie  Murray

Verdie Murray

1655567640

Build Full Stack Web Application Using ASP.NET 6 Web API & JS (Part 2)

This is PART-2 of the video series - Build Full Stack Web Application Using ASP.NET Core Web API and Javascript Client - Notes App

In this video, you will learn to create an amazing full-stack application that will be used to show, add, and delete update notes.
This will be a great learning experience and in this one, we will create a backend API using ASP.NET 6 (.NET 6) and use Entity Framework core to persist our data.
we will also create a front-end client using HTML CSS and javascript and we will tie both these applications together to create a wonderful full-stack web application.


Part 1: ☞ https://morioh.com/p/bb9a3d230265?f=60f4f1553116637331ec4e8e

In the ASP.NET 6 Web API, we will install Entity Framework Core to talk to our SQL Server database and perform CRUD operations.

In the Client Side, we will create our UI Client using HTML, CSS and Javascript.

We will use the Fetch API to make HTTP Calls to our .NET API and make CRUD operations on the API.

We will also enable CORS on the .NET API.

#javascript #aspnetcore #fullstack #dotnet #html #css

Build Full Stack Web Application Using ASP.NET 6 Web API & JS (Part 2)
Verdie  Murray

Verdie Murray

1655549387

How to Build Full Stack Web Application Using ASP.NET 6 Web API & JS

This is PART-1 of the video series - Build Full Stack Web Application Using ASP.NET Core Web API and Javascript Client - Notes App

In this video, you will learn to create an amazing full-stack application that will be used to show, add, and delete update notes.
This will be a great learning experience and in this one, we will create a backend API using ASP.NET 6 (.NET 6) and use entity framework core to persist our data.
we will also create a front-end client using HTML CSS and javascript and we will tie both these applications together to create a wonderful full-stack web application.

Part 2: ☞ https://morioh.com/p/3b5403f930b3?f=60f4f1553116637331ec4e8e

In the ASP.NET 6 Web API, we will install Entity Framework Core to talk to our SQL Server database and perform CRUD operations.

In the Client Side, we will create our UI Client using HTML, CSS and Javascript.

We will use the Fetch API to make HTTP Calls to our .NET API and make CRUD operations on the API.

We will also enable CORS on the .NET API.

#javascript #aspnetcore #fullstack #html #css #dotnet

How to Build Full Stack Web Application Using ASP.NET 6 Web API & JS

How to Build Web Applications with ASP.NET Core and .NET 6

Learn C# with CSharpFritz - Beginning Web Development with .NET

Fritz kicks off a new series, teaching how to get started with web development using ASP.NET Core


Introducing Web Development with ASP.NET Core

.NET 6, and .NET Core before it was originally built to make cloud development of web applications easier and deliver the smallest and fastest web applications that take advantage of all the cloud technologies. According to the May 2020 Techempower benchmark, ASP.NET Core is the fastest framework available:

Benchmark results

In this Second Season of CSharp with CSharpFritz, we're going to learn all about how to build web applications with ASP.NET Core and .NET 6.

Assumptions

Starting with this season, we are going to assume that you've been through the first season and that you know the basics of working with C#. Additionally, we're going to assume that you are familiar with the syntax of HTML and CSS. We'll discuss web server architecture, but no previous web application development experience will be assumed.

Tools Needed

To get started with ASP.NET Core, you can work on Windows, Mac, or Linux using your favorite text editor. You can use a full development environment like Visual Studio 2019 on Windows, or something as simple as vim or emacs.

Get the .NET 6 SDK from get.dot.net

ASP.NET Core templates / project models

ASP.NET Core is a framework for building web applications that generate HTML, the document format that web browsers understand, on a server and delivering that HTML to the browser. The framework is built on top of the .NET Framework, which is a cross-platform, open-source, and cross-platform development platform.

ASP.NET Core comes with a number of templates that you can use to get started with your web application. These templates are called "project models". You can use these templates to create a new project, or you can use them to start with a project that you already have.

Here are the templates that ship with ASP.NET Core in the .NET 6 SDK:

Template NameShort NameLanguage
ASP.NET Core Emptyweb[C#],F#
ASP.NET Core gRPC Servicegrpc[C#]
ASP.NET Core Web APIwebapi[C#],F#
ASP.NET Core Web Appwebapp,razor[C#]
ASP.NET (Model-View-Controller)mvc[C#],F#
ASP.NET Core with Angularangular[C#]
ASP.NET Core with React.jsreact[C#]
ASP.NET Core with React.js and Reduxreactredux[C#]

You can find these templates in Visual Studio in the File - New menu. If you are working at the command-line outside of Visual Studio, you can use the dotnet new command to create a new project from one of these templates.

Websites are console apps!

Folder Structure

The default folder structure for Razor Pages is:

- Pages
|- Index.cshtml
|- Shared
- wwwroot
- MyApp.csproj
- Program.cs

The MyApp.csproj file contains the definition of the web project so that .NET knows how to compile and prepare the web server.

The wwwroot folder contains the files that are served to the browser without interaction of the server. The content of these files is simply read and delivered as requested. You will find JavaScript, CSS, fonts, and images in the wwwroot folder.

The Pages folder contains the Razor Pages that are interpreted and served to the browser. Inside the Pages folder is a Shared folder that contains the shared code that can used by all Razor Pages. You'll find a shared layout in this folder by default.

Program.cs

Program is a top-level file that, as of .NET 6, does not contain any C# classes or methods. It is the entry point for your application. It is the first file that is executed when the application starts. It is the only file that is executed when you run the application.

Program.cs configures the web server, application services, and starts the web server. At that point, control is handed over to the individual pages, controllers, and implemented code in the rest of your application.

Startup.cs

In older versions of ASP.NET Core, Program.cs would start the web server and hand-off configuration of application services to a class named Startup.cs. You can still use this architecture to configure your application with ASP.NET Core in .NET 6, but it is no longer the recommended approach.

Razor Pages and Razor

In ASP.NET Core, we use a template language called Razor to define and format the HTML we will deliver to the browser. The Razor templates are executed on the server when the content they define is requested and the output of the template is delivered to the browser.

In our first project template we will work with, we'll use Razor Pages to deliver HTML to the browser. Razor Pages allow you to define interactions with the server as a Page or individual file that is requested by the browser.

Introducing Razor Syntax

Building and working with our application

If you are using Visual Studio 2022, you can use the Start button on the toolbar to start the web server. This will start the web server and allow you to interact with the server. You can use the Stop toolbar button to stop the web server.

If you are working with the application at the command-line, you can use the dotnet run command to start the web server. This will start the web server and allow you to interact with the server. You can also use the dotnet watch command to start the server and automatically patch content as you update it on the server.

#csharp #aspnetcore #dotnet

How to Build Web Applications with ASP.NET Core and .NET 6
Cleora  Roob

Cleora Roob

1650667980

Create a .NET custom database logging provider with ASP.NET Core's ILogger and ILoggerProvider

One of the great things about .NET is being able to create a custom logging provider.

Creating a logging provider is relatively easy in ASP.NET Core as you can build the functionality around methods that are contained in the ILogger and ILoggerProvider interfaces.

This video will walk you through the steps to create a custom logging provider that will take appsettings.json properties to log to a SQL Server database table.

It will walk you through how to configure and implement database logging through an ASP.NET Core app. There is functionality available to configure error handling on particular assemblies and namespaces.

As we are writing the log in JSON format, we'll show you how to query JSON strings if you're using SQL Server 2017, or above.

► Chapters
0:00 Coming up...
0:11 How to create a custom logging provider
0:54 Code walkthrough
4:24 Code demo
4:40 JSON in SQL Server
5:41 Other custom logging providers

► More information: https://www.roundthecode.com/dotnet/create-custom-database-logging-provider-asp-net-core-ilogger?

#ilogger #aspnetcore #sqlserver

Create a .NET custom database logging provider with ASP.NET Core's ILogger and ILoggerProvider
Cleora  Roob

Cleora Roob

1650495120

How ASP.NET Core logging works and use ILogger and ILoggerProvider to write a log

Logging in .NET can be done with an ASP.NET Core application using the ILogger and ILoggerProvider interfaces in C#.

Both the interfaces come from the Microsoft.Extensions.Logging assembly, and can be installed with the Microsoft.Extensions.Logging.Abstractions NuGet package.

In-order to write a log, the ILogger provides a number of extension methods that allows us to set the severity of the log. The levels are set with the LogLevel enum, and each level has it's own extension method.

In-addition, to display or store logs, we can use a logger provider. There are a number of logger providers built into the .NET shared framework, like the console. Alternatively, we can write a custom logger using the method abstractions in ILoggerProvider.

We have a look at how to write a log, the different log levels and how to set the severity for an assembly, and how to configure writing logs for different custom providers.

► Chapters
0:00 Coming up...
0:06 ASP.NET Core logging overview
0:44 How logging works in ASP.NET Core
3:23 Logging providers
5:18 Why logging is important

► More information: https://www.roundthecode.com/dotnet/how-aspnet-core-logging-works-ilogger-loglevel?utm_source=youtube&utm_medium=referral&utm_campaign=How+ASP.NET+Core+logging+works+and+use+ILogger+and+ILoggerProvider+to+write+a+log

#ilogger #aspnetcore

How ASP.NET Core logging works and use ILogger and ILoggerProvider to write a log
Shannon  Rippin

Shannon Rippin

1650342180

Use Visual Studio Code As A Code Editor To Work on .net Applications

Explained how to install .net SDK and Create Asp.net core web application.
how to use Visual studio code as a code editor to work on  .net applications.

Timeline :
00:00 Dotnet SDK Installation
02:36 create .net core web application
04:52 Open Core app with Visual Studio Code 
06:23 Code editing with VSCode
08:06 VSCode Extensions

#aspnetcore  #vscode #dotnet 

Use Visual Studio Code As A Code Editor To Work on  .net Applications
Cleora  Roob

Cleora Roob

1650322200

Use ASP.NET Core Hosted Services to Run A Background Task

Hosted services were introduced in .NET Core 3.1 and are an excellent way of running a background service.

They can be run in an ASP.NET Core web application, which is ideal if we need update data that would affect all users.

We look at how to create a hosted service, and what the difference is between inheriting the IHostedService interface and the BackgroundService abstract class.

In addition, we'll find out the difference between starting a background task using the StartAsync method against the ExecuteAsync method.

Afterwards, we'll demonstrate how to add hosted services to the IServiceCollection.

Finally, we'll see how hosted services reacted with dependency injection, and why hosted services can successfully resolve a singleton and transient service, but not a scoped service.

💻 Download the source code 💻
https://www.roundthecode.com/dotnet-samples/asp-net-core-hosted-service-dotnet-6?utm_source=youtube&utm_medium=referral&utm_campaign=Use+ASP.NET+Core+hosted+services+to+run+a+background+task

► Chapters
0:00 The hosted services area covered
0:48 Creating a hosted service
2:51 Add a hosted service to IServiceCollection
5:10 How dependency injection works
8:37 Should we use a worker service?

 #aspnetcore 

Use ASP.NET Core Hosted Services to Run A Background Task
Cleora  Roob

Cleora Roob

1650278880

How to Troubleshoot and Fix ASP.NET Core Bugs in A Production Environm

ASP.NET Core bugs in a production environment can be prevented through the use of testing and a sound deployment procedure.

However, despite the process that is in place, there is often some problems that get through the net.

First, we will have a look at how we can track ASP.NET Core production bugs. ASP.NET Core provides a logging provider which can be installed from a Nuget package. From there, we can log errors which allows us to track, troubleshoot and fix ASP.NET Core bugs.

Once a bug has been discovered, we can attempt to recreate the bug locally and implement a fix.

What if we can't recreate the bug locally? Another way of tracking a bug is through the use of a Performance Profiler and Visual Studio has one built in. We will have a look at how this works in Visual Studio.

► Chapters
0:00 How production bugs can be avoided
0:42 ASP.NET Core logger provider
2:36 Reproduce the error
3:04 Visual Studio performance profiler
5:08 Why it's better not to have bugs

► More information: https://www.roundthecode.com/dotnet/how-to-troubleshoot-and-fix-asp-net-core-bugs-in-a-production-environment

#aspnetcore  #visualstudio  #dotnet 

How to Troubleshoot and Fix ASP.NET Core Bugs in A Production Environm
Reggie  Hudson

Reggie Hudson

1649548740

How to Upload A File in ASP.NET CORE and C#

In this video, we will see how we can upload a file in ASP.NET CORE and C#.

We will create a razor pages web application and then use Bootstrap as our CSS library to create a form in HTML. 
Then we will add a submit button to the form and create a POST method in the razor code.

We will accept an IFormFile and we will save the file to the local repository using a service.
We will inject this FileUploadService to achieve dependency injection.

#aspnetcore  #FileUpload #razorpages #csharp #razor 

How to Upload A File in ASP.NET CORE and C#

Thomas Ardal

1648533923

Search videos through the YouTube Data API from C#

Search videos through the YouTube Data API from C# https://blog.elmah.io/search-videos-through-the-youtube-data-api-from-c/ #aspnetcore #dotnet #dotnetcore #csharp #youtube

Search videos through the YouTube Data API from C#
dot NET

dot NET

1647423247

New Web Developer Tools in Visual Studio

ASP.NET Community Standup - New web tools in Visual Studio

Get a look at some exciting new web developer tools in Visual Studio with Sayed I. Hashimi and Christian Heilmann!

Chapters:
00:00 Countdown
02:20 Welcome and Community Links
08:30 Demo: Edge developer tools in Visual Studio 2022
58:22 Demo: Edge developer tools in Visual Studio Code
1:00:08 Q&A and Closing

#aspnetcore #webdev #visualstudio #dotnet #vscode #visualstudiocode

New Web Developer Tools in Visual Studio
Eliseo  Kutch

Eliseo Kutch

1645520820

ElasticSearch to WebAPI using AspNet Core

In this video we will go through AspNet Core Elastic Search. When do you want to use each and give you a better understanding on they fit together.

We will go into details how we can add Elastic Search to our Web API as well create controller and actions where we implement search and adding items to our Elastic Search index.

Starting Source code:
https://github.com/mohamadlawand087/Net6-ELK

#elasticsearch #dotnet #webapi #aspnetcore 

ElasticSearch to WebAPI using AspNet Core