10 Replies
I think you shouldn't ignore your warnings
I think it is fine other than warning, but could get tedious when you need more than
Where
.It is difficult for me to provide a detailed opinion on the specific usage of the generic method without more context about the purpose of the method and the specific requirements of the project. In general, using a generic method can be a useful way to write reusable code that can be applied to different types of entities. It can make code easier to maintain and update, and can make it easier to read and understand. However, it is also important to carefully consider the trade-offs of using a generic method, such as the potential impact on performance and testing, as well as the level of type safety in the code. Ultimately, the decision of whether to use a generic method or not should be based on a careful evaluation of the specific needs and constraints of the project, as well as a broader design of the codebase. I hope this helps.
did you copy this from chatGPT?
yes i did
chatgpt doesnt know conventions or good pratices. it just generates a response based on what it was trained on. which means it can be very wrong without seeming like it
tldr: dont ask chatgpt about things like this
I think "don't use generic repositories over EF"
If someone's holding you at gunpoint, though, I'd say it looks good enough
Although I'd probably use an overloaded method instead
One-liner methods that are essentially
have the added benefit of showing how pointless they are
Thank you everyone
Do you suggest create extensions for efcore? or for entities
Yeah, IQueryable extensions are fine
I have plenty of them, like
.Paginate()
or .FilterBlocked()
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.