-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the search faster, hopefully! (#17)
* Make search faster! Refactor models! Also trims whitespaces a lot * Make main page link the leftmost one as is conventional
- Loading branch information
1 parent
4841599
commit f7d7e2d
Showing
35 changed files
with
716 additions
and
699 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,34 @@ | ||
namespace ReplayBrowser.Data.Models.Account; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
public class Account | ||
namespace ReplayBrowser.Data.Models.Account; | ||
|
||
public class Account : IEntityTypeConfiguration<Account> | ||
{ | ||
// Primary key | ||
public int Id { get; set; } | ||
|
||
public Guid Guid { get; set; } | ||
public string Username { get; set; } | ||
public bool IsAdmin { get; set; } = false; | ||
public AccountSettings Settings { get; set; } = new(); | ||
|
||
/// <summary> | ||
/// Replays that the user has favorited. | ||
/// </summary> | ||
public List<int> FavoriteReplays { get; set; } = new(); | ||
|
||
/// <summary> | ||
/// Profiles that the user "watches". | ||
/// </summary> | ||
public List<Guid> SavedProfiles { get; set; } = new(); | ||
public List<HistoryEntry> History { get; set; } = new(); | ||
|
||
public bool Protected { get; set; } = false; | ||
|
||
public void Configure(EntityTypeBuilder<Account> builder) | ||
{ | ||
builder.HasIndex(a => a.Guid).IsUnique(); | ||
builder.HasIndex(a => a.Username); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.