0

New to EF... using 6.0. I've have a Stored Proc which has the dynamic build select query inside a string variable that outputs using Execute(@StringQuery). This select has around 20 columns.

After adding this SP in EF, the return type is INT (not sure why). But I think I've to add all the columns manually in Complex types in EDMX. Wanted to know whether there is any better way to handle this as the columns are in huge number.

Please suggest.

Procedure Text:

DECLARE @StringQuery VARCHAR(MAX)
SET @StringQuery = 'SELECT AROUND 20 COLUMNS WITH LOT OF CONDITIONS ADDED'

EXECUTE(@StringQuery)
Interstellar
  • 662
  • 2
  • 10
  • 29

1 Answers1

1
  1. Open your model
  2. Go to View->Other Windows->Entity Data Model Browser
  3. In browser expand your Model->Function Imports and double click on Stored Proc
  4. In Returns a Collections off choose Complex and press Get Column Information
  5. Click Create New Complex Type
  6. OK, Save
Giorgi Nakeuri
  • 35,155
  • 8
  • 47
  • 75