❔ Code review

MAMuhammet Ali12/24/2022
What do you think about this usage at generic repository?
Image
EEro12/24/2022
I think you shouldn't ignore your warnings
Ccathei12/24/2022
I think it is fine other than warning, but could get tedious when you need more than Where.
AAtamakit12/24/2022
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.
CCyberrex12/24/2022
did you copy this from chatGPT?
AAtamakit12/24/2022
yes i did
CCyberrex12/24/2022
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
CCyberrex12/24/2022
tldr: dont ask chatgpt about things like this
AAngius12/24/2022
I think "don't use generic repositories over EF"
AAngius12/24/2022
If someone's holding you at gunpoint, though, I'd say it looks good enough
AAngius12/24/2022
Although I'd probably use an overloaded method instead
AAngius12/24/2022
One-liner methods that are essentially
public T GetAll<T>(x) => ctx.GetAll<T>(x);

have the added benefit of showing how pointless they are
MAMuhammet Ali12/24/2022
Thank you everyone
MAMuhammet Ali12/24/2022
Do you suggest create extensions for efcore? or for entities
AAngius12/24/2022
Yeah, IQueryable extensions are fine
AAngius12/24/2022
I have plenty of them, like .Paginate() or .FilterBlocked()
AAccord12/25/2022
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.