Neophyte
Neophyte
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
maybe this would reach the desired result with the least effort while not compromising too much on the standards
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
that way the return type can be set in the interface without the need of a generic solution
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
like serializing into a json, or stg. similar
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
I am thinking on establishing an abstraction that will grant the errors are on a common structure.
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
that's what I understood from above discussion
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
the one calling IDataInterface.Validate<T, TError>(values) won't know compiletime the type of TError. Since he the specific implementation of IDataInterface is resolved only during runtime
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
unless you abstract the errors to a common structure, disregarding the systemType
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
yet this still wouldn't fix the generic return type problem. In above example you have used TError, but it is not in the method signature. So it must be a specific type
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
maybe adding IParserFactory instead of the specific TParser could help. At the end, the parser will have to do the same. Parse<T>(Stream stream) no matter the implementation. This could reducde the number of generics needed. Same with TConverter
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
it was an educative discussion, I appreciate it!
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
ok, thanks!
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
but I understand this cannot work
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
Thus I have created a new contract in the Interface Type GetMyType() so it would return the specific type
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
no, its an example name I used here so we ain't limited by the system. but there are AwsSystemDto, AzureSystemDto, HrCsvData (HrSystemDto)
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
HrCsvData is a SystemDto. It s the system dto for HR systems uploaded from CSV
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
(method name is to be fixed though)
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
here in ConvertDtosToEntries()
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
replace any HR with Azure. by accident I have just taken a different example
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
the ValidatedHrCsvData here extends the SystemDto
105 replies
CC#
Created by Neophyte on 11/18/2024 in #help
How to to dynamically provide T type of a generic method
the data is not stored yet anywhere, thus I don't have any Id reference to rely on..
105 replies