5 Replies
Is it absolutely wrong to do it like so?
I'll be using this instead
The first version is definitely not ideal, you have a shadowed property, and this would also be prone to boxing in case T is a value type
Second option definitely looks better
Although I'm not sure when you would need an object as the Data opposed to the T itself
There's a bunch of result implementations out there you can just use as well
I need the object so I can return the Data itself
In this result.ToActionResult() method, I dont know <T>
But you could create an extension method on Result<T>, transforming it into an ActionResult<T>
Honestly I just scrapped the whole thing hahahah
Im just using a very barebones result right now
I will rework it later on