У меня есть три таблицы Product, Location, StockLocation. Я хочу, чтобы данные отображались в виде столбца, а местоположение должно быть динамическим:
Я хочу заполнить данные в моем ядре asp.netAPI-приложение, использующее ядро Entity Framework и показывающее его в моем проекте Angular 7. Если это возможно в любой клиентской библиотеке с открытым исходным кодом, предложите мне.
SQL - это:
CREATE TABLE [Product](
[ProductId] [int] IDENTITY(1,1) PRIMARY KEY NOT NULL,
[ProductName] [varchar](250) NOT NULL,
[Description] [nvarchar](500) NULL,
[Code] [varchar](50) NULL,
[SalesPrice] [decimal](18, 0) NULL
)
GO
CREATE TABLE [Location](
[LocationId] [int] IDENTITY(1,1) PRIMARY KEY NOT NULL,
[LocationName] [varchar](50) NOT NULL
)
GO
CREATE TABLE [StockLocation](
[StockId] [bigint] IDENTITY(1,1) NOT NULL,
[StockProductId] [int] NOT NULL,
[StockLocationId] [int] NOT NULL,
[TotalQuantity] [decimal](18, 0) NOT NULL,
CONSTRAINT [PK_StockLocation] PRIMARY KEY CLUSTERED
(
[StockId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StockLocation] WITH CHECK ADD CONSTRAINT [FK_StockLocation_Location] FOREIGN KEY([StockLocationId])
REFERENCES [dbo].[Location] ([LocationId])
GO
ALTER TABLE [dbo].[StockLocation] CHECK CONSTRAINT [FK_StockLocation_Location]
GO
ALTER TABLE [dbo].[StockLocation] WITH CHECK ADD CONSTRAINT [FK_StockLocation_Product] FOREIGN KEY([StockProductId])
REFERENCES [dbo].[Product] ([ProductId])
GO
------------ Data-------
INSERT [dbo].[Product] ([ProductName], [Description], [Code], [SalesPrice]) VALUES ( N'Ravtop', N'M3 Plus Smart Bracelet Heart Rate Blood Pressure Health Waterproof Smart Watch M3 Pro Bluetooth ', N'R200154', CAST(2250 AS Decimal(18, 0)))
GO
INSERT [dbo].[Product] ([ProductName], [Description], [Code], [SalesPrice]) VALUES ( N'B57 Water Proof', N'B57 Smart watches Waterproof Sports for iphone phone Smartwatch Heart Rate Monitor Blood Pressure Functions For Women men kid', N'B570021', CAST(1850 AS Decimal(18, 0)))
GO
INSERT [dbo].[Product] ([ProductName], [Description], [Code], [SalesPrice]) VALUES ( N'CHYCET', N'2019 Bluetooth Smart Watch Men Blood Pressure Round Smartwatch Women Watch Waterproof Sport', N'C220172', CAST(2400 AS Decimal(18, 0)))
GO
INSERT [dbo].[Product] ([ProductName], [Description], [Code], [SalesPrice]) VALUES ( N'Kaihai H 69', N'KAIHAI H69 ECG PPG SpO2 HRV fitness health smart watch men electronic blood pressure measurement Heart rate monitor smartwatch', N'KHSW69', CAST(2800 AS Decimal(18, 0)))
GO
INSERT [dbo].[Product] ([ProductName], [Description], [Code], [SalesPrice]) VALUES ( N'Lempo IP67', N'LEMFO Smart Watch Women OTA Update IP67 Waterproof Blood Pressure Heart Rate Call Message Reminder for Sports Watch', N'L5800AD', CAST(2800 AS Decimal(18, 0)))
GO
INSERT [dbo].[Product] ([ProductName], [Description], [Code], [SalesPrice]) VALUES ( N'ZGPAX', N'Smart Watch Men Women 1.3 Inch Round Screen Smart Watch Blood Pressure Measurement Oxygen Smartwatch Watch Smart For IOS Andriod', N'2554223', CAST(1120 AS Decimal(18, 0)))
GO
INSERT INTO [Location](LocationName) VALUES ('Head Office')
INSERT INTO [Location](LocationName) VALUES ('Uttara')
INSERT INTO [Location](LocationName) VALUES ('MES')
INSERT INTO [Location](LocationName) VALUES ('Chittagong')
INSERT INTO [Location](LocationName) VALUES ('Rajshahi')
INSERT INTO [Location](LocationName) VALUES ('Sylhet')
INSERT INTO [StockLocation]([StockProductId],[StockLocationId],[TotalQuantity])VALUES (1,1,4700)
INSERT INTO [StockLocation]([StockProductId],[StockLocationId],[TotalQuantity])VALUES (1,2,4100)
INSERT INTO [StockLocation]([StockProductId],[StockLocationId],[TotalQuantity])VALUES (1,3,200)
INSERT INTO [StockLocation]([StockProductId],[StockLocationId],[TotalQuantity])VALUES (1,4,400)
INSERT INTO [StockLocation]([StockProductId],[StockLocationId],[TotalQuantity])VALUES (1,5,850)
INSERT INTO [StockLocation]([StockProductId],[StockLocationId],[TotalQuantity])VALUES (2,1,50)
INSERT INTO [StockLocation]([StockProductId],[StockLocationId],[TotalQuantity])VALUES (2,2,520)
INSERT INTO [StockLocation]([StockProductId],[StockLocationId],[TotalQuantity])VALUES (2,3,200)
INSERT INTO [StockLocation]([StockProductId],[StockLocationId],[TotalQuantity])VALUES (2,5,40)
INSERT INTO [StockLocation]([StockProductId],[StockLocationId],[TotalQuantity])VALUES (3,1,412)
INSERT INTO [StockLocation]([StockProductId],[StockLocationId],[TotalQuantity])VALUES (3,5,45)
INSERT INTO [StockLocation]([StockProductId],[StockLocationId],[TotalQuantity])VALUES (3,4,34)