我想知道如何使用 LINQ (C#) 执行以下操作。所有帮助将不胜感激,谢谢。
DECLARE @productId int
INSERT INTO product(title, studioId, developerId, publisherId, releasedateUK, releasedateUS, certUK, certUS, dateAdded, pageSlug)
VALUES (@title, @studioId, @developerId, @publisherId, CONVERT(Date, @releaseDateUK, 103), CONVERT(Date, @releaseDateUS, 103), @certUK, @certUS, GETDATE(), @Slug)
SET @productId = SCOPE_IDENTITY()
--Insert Product Details
INSERT INTO productDetails(productId, is3D, is4K, isTriplePlay, hasDVD, hasDigital, running, regiona, regionb, regionc, releaseYear, synopsis, imdbrating)
VALUES (@productId, @is3D, @is4K, @isTriplePlay, @hasDVD, @hasDigital, @runningTime, @regiona, @regionb, @regionc, @releaseYear, @synopsis, @imdbrating)
更新:这是来自我编写的 SPROC,我基本上需要插入一个产品,获取该 ID,然后我也可以插入其他表。