for-json

retrieve json with entityframework core

萝らか妹 提交于 2021-02-04 21:32:07
问题 I have store procedures returning json, thanks to for json path. How do you consume them with entity-framework-core? The following doesn't work: var foo = _db.Set<JObject>() .FromSql("dbo.Mine @customerid = {0}", _user.guid) .FirstOrDefault(); Because JObject type is not part of the model: InvalidOperationException: Cannot create a DbSet for 'JObject' because this type is not included in the model for the context. But how are we supposed to do that with entity-framework-core? 回答1: After

retrieve json with entityframework core

十年热恋 提交于 2021-02-04 21:31:48
问题 I have store procedures returning json, thanks to for json path. How do you consume them with entity-framework-core? The following doesn't work: var foo = _db.Set<JObject>() .FromSql("dbo.Mine @customerid = {0}", _user.guid) .FirstOrDefault(); Because JObject type is not part of the model: InvalidOperationException: Cannot create a DbSet for 'JObject' because this type is not included in the model for the context. But how are we supposed to do that with entity-framework-core? 回答1: After

SQL Server - “for json path” statement does not return more than 2984 lines of JSON string

为君一笑 提交于 2020-01-01 19:24:15
问题 I'm trying to generate huge amount of data in a complex and nested JSON string using "for json path" statement, and I'm using multiple functions to create different parts of this JSON string, as follow: declare @queue nvarchar(max) select @queue = ( select x.ID as layoutID , l.Title as layoutName , JSON_QUERY(queue_objects (@productID, x.ID)) as [objects] from Layouts x inner join LayoutLanguages l on l.LayoutID = x.ID where x.ID = @layoutid group by x.ID, l.Title for json path ) select