Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code quality refactor of the PlayerRepository #304

Open
13 tasks
myssto opened this issue May 10, 2024 · 0 comments
Open
13 tasks

Code quality refactor of the PlayerRepository #304

myssto opened this issue May 10, 2024 · 0 comments

Comments

@myssto
Copy link
Contributor

myssto commented May 10, 2024

The PlayerRepository needs a bit of cleanup. Some methods need to be renamed, and the documentation on the interface should be polished.

Tasks:

  • Organize methods so that all private members come after public ones
  • Organize methods so that all overloads follow each other in order
  • Clean up XML documentation of IPlayerRepository (remove empty returns tags, use similar wording to other repos)
  • Per-method tasks
    • Rename GetPlayersMissingRankAsync to GetAllMissingRankAsync
    • Refactor GetAsync(bool eagerLoad) to be an overload of RepositoryBase.GetAllAsync()
    • Edit GetAsync(string username) to not throw an exception
    • Edit GetOrCreateAsync(long osuId) to use GetAsync(osuId) instead of checking for an existing entity first
    • Remove unused method GetAsync(long osuId, bool eagerLoad, int mode = 0, int offsetDays = -1)
    • Refactor GetTopRatingsAsync(int n, Ruleset ruleset)
      • Parameter int n to int limit
      • Use LINQ functions instead of SQL syntax
    • Identify and correct usages of Get{Property}Async (Many places where these are used call multiple of them in succession, which creates an unnecessary amount of database calls. Most can be fixed by simply calling GetAsync(int id) and using the resulting entity)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant