FetchProjection<MyPoco>() but with different field names

Posts   
 
    
ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 19-Jan-2021 01:31:40   

Note: Oracle 11, I can't change anything about it. and the Proc doesn't return a TypedList to LLBL because calling it with all null params by LLBL results in no result set.

When I call:

 var a = adapter.FetchProjection<MyPoco>(reader);

I get back the MyPoco fine.

However, MyPoco has to have fields like "MY_UGLY_FIELDNAME_WITH_UNDERSCORES" for the FetchProjection to work.

Is there an [Attribute] I can use on MyPoco to tell FetchProjection that it should use a different name.

Like this

     [LLBLPropertyName("MY_UGLY_FIELDNAME_WITH_UNDERSCORES")]
     public string VeryPrettyName { get; set; }
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 19-Jan-2021 10:03:36   

Sorry, no...

Did you try to specify default values for the types on the stored procedure tab in the relational model data retrieval wizard? There's a button there which allows you to specify default values for types. LLBLGen Pro doesn't send 'null' for parameters btw, but 0 or "".

If that doesn't help, try to extract the schema and import it into a local oracle db which you can control, so you can alter the proc there, then sync the project with that one. but this is all tedious, I know, however there's little we can do. The fields in the resultset have an order (ordinal) but the fields in the type do not.

You could also use the dataprojector route: https://www.llblgen.com/Documentation/5.7/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/Adapter/gencode_datareadersprojections_adapter.htm#projecting-dynamic-list-resultset-onto-poco-classes which is a bit verbose but should allow you to define the mappings of the ordinal -> field.

Frans Bouma | Lead developer LLBLGen Pro