You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expression of type 'System.Collections.Generic.List1[RandomFlightDataGen.Model.IATA_AIDX_FlightLegNotifRQ.FlightLegType]' cannot be used for return type 'System.Collections.Generic.List1[RandomFlightDataGen.Model.IATA_AIDX_FlightLegNotifRQ.IATA_AIDX_FlightLegNotifRQ]
This makes sense, because the initial call is with T where T is IATA_AIDX_FlightLegNotifRQ what I am unsure of is how do I for the Expression Lambda instead of using T use the type of the class on the property which I have inferred and created a MakeGenericMethod call for.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a complex class tree graph and was looking to autopopulate all properties with mock data. I have the following code
` var faker = AutoInferRules<IATA_AIDX_FlightLegNotifRQ>();
var flight = faker.Generate();
static Faker AutoInferRules() where T : class, new()
{
var faker = new Faker();
}
static List GenerateList() where T : class, new()
{
var faker = AutoInferRules();
return new List { faker.Generate() };
}`
I get an error on the line:
The error is
This makes sense, because the initial call is with T where T is IATA_AIDX_FlightLegNotifRQ what I am unsure of is how do I for the Expression Lambda instead of using T use the type of the class on the property which I have inferred and created a MakeGenericMethod call for.
Beta Was this translation helpful? Give feedback.
All reactions