[Part 3] - Build an ASP.NET Core 3.1 Web API and Consume with MVC (Analyse SQL Database Tables)

preview_player
Показать описание
++++++++++++ UDEMY COURSE DISCOUNTS LIMITED TIME ++++++++++++++
Latest Limited Time Udemy Promo Links (Expires 30th August 2024, 06:00PM GMT+12)

These are all Microsoft full-stack courses of great demand each having lots of assignments and quizzes to self-evaluate learning progress.
So come forward and enroll in them.

In my previous (second) episode, I started the hands-on project in Visual Studio 2019 from scratch by building an ASP.NET Core 3.1 Web API project from the empty project template. I will build the project from scratch and walk you through the code explaining everything in the process. All the episodes will be in continuation from the previous ones, so it is highly recommended to be up to date with all the previous episodes before viewing this one.

This is part 3 of a multi-part series of tutorials on How to Build a Web API and Consume it in ASP.NET Core MVC using SQL Server and ADO.NET. In this tutorial, I will explain the pre-existing SQL Server database table structure.

Like || Share || Spread || Love

❝Scripts: (Assuming Database WebAPIDb already exists)
Customer (Table):
USE [WebAPIDb]
GO
CREATE TABLE [dbo].[Customer](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](50) NOT NULL,
[Address] [nvarchar](max) NULL,
[Telephone] [nvarchar](50) NULL,
[Email] [nvarchar](50) NULL,
CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
Order (Table)
USE [WebAPIDb]
GO
CREATE TABLE [dbo].[Order](
[Id] [int] IDENTITY(1,1) NOT NULL,
[CustomerId] [int] NOT NULL,
[Description] [nvarchar](max) NULL,
[OrderCost] [money] NULL,
CONSTRAINT [PK_Order] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[Order] WITH CHECK ADD CONSTRAINT [FK_Order_Customer] FOREIGN KEY([CustomerId])
REFERENCES [dbo].[Customer] ([Id])
ON UPDATE CASCADE
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[Order] CHECK CONSTRAINT [FK_Order_Customer]
GO


For more updates Follow us on:-

#KaushikRoyChowdhaury #AspNetTutorials #WebAPITotorials #MVC

🚀 Explore top-notch courses at just US$ 9.99 until August 12, 01:00 PM (NZ Time). 🏆

🔥 Limited-time offer Don't miss out 🔥
Рекомендации по теме
join shbcf.ru