Open malathyr opened 7 years ago
Sorry, there is nothing I can do. It is SQL Server that tells me what gets returned.
Perhaps you can specify the columns instead of SELECT *
, or alternatively, write a wrapper stored proc which calls this one and returns the columns correctly.
Is there not an alternative to SET FMTONLY ON? Which may work better?
Let me check on this.
Thank you for the quick reply. Appreciate it very much
Thanks Ramesh
On Wed, Aug 2, 2017 at 2:33 PM, Erik Ejlskov Jensen < notifications@github.com> wrote:
Is there not an alternative to SET FMTONLY ON? Which may work better?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/316#issuecomment-319774901, or mute the thread https://github.com/notifications/unsubscribe-auth/ADkZCS-Wp0gPIDtIJKoVhEA5-DrL_1wkks5sUM8NgaJpZM4Orhgo .
Thank you Simon/Eric for the quick reply. Appreciate it very much
is the following possible by any chance
If I want to set validation for some columns can I it as partial class and set validation attributes in the partial class created by me?
Other cases related to this are: #173, #183, #260
FMTONLY doesn't work with the generator.
My workaround for now is to exclude them from generation and write them myself.
My workaround for this was to check at the start of the procedure if the parameters passed in are NULL, as that is how the generator passes them in. If so create a table variable representing the actual output, select from that and return immediately.
CREATE PROCEDURE spExample
@SomeValue varchar(50)
AS
BEGIN
SET NOCOUNT ON;
-- Reverse POCO generator
IF (@SomeValue IS NULL)
BEGIN
DECLARE @t TABLE(ColumnOne uniqueidentifier not null, ColumnTwo varchar(20))
SELECT * FROM @t
RETURN
END
-- Actual SP contents here.
END
GO
I have a SP and I have dynamic SQL getting executed and it returns a resultset. But when the Reverse POCO generates a method for the SP and it returns the result as int (for @return_value). is there a way it can detect the columns Sample SP
Also, if I want to set validation for some columns can I it as partial class and set validation attributes in the partial class created by me?