diff options
| author | Victor S <57849063+transtrike@users.noreply.github.com> | 2021-04-02 23:55:25 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-02 23:55:25 +0300 |
| commit | bad7456b379bcc683431e2279591f7c5227bd55a (patch) | |
| tree | b82e15d10e28759dcd066b38ccdd16c23753b33c /src/Data/DevHive.Data/Repositories | |
| parent | 2448c4d31188aed26605c5e3c282bacc3bd71ae5 (diff) | |
| parent | b0c6c6e1795a1cc8fe82a60ce16a263ab4cad397 (diff) | |
| download | DevHive-bad7456b379bcc683431e2279591f7c5227bd55a.tar DevHive-bad7456b379bcc683431e2279591f7c5227bd55a.tar.gz DevHive-bad7456b379bcc683431e2279591f7c5227bd55a.zip | |
Merge pull request #24 from Team-Kaleidoscope/feature/profile_picture_implementation
- Removed InsertProfilePicture from Service layer (unneeded)
- ReadProfilePicture endpoint implemented
Diffstat (limited to 'src/Data/DevHive.Data/Repositories')
| -rw-r--r-- | src/Data/DevHive.Data/Repositories/ProfilePictureRepository.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Data/DevHive.Data/Repositories/ProfilePictureRepository.cs b/src/Data/DevHive.Data/Repositories/ProfilePictureRepository.cs new file mode 100644 index 0000000..7284464 --- /dev/null +++ b/src/Data/DevHive.Data/Repositories/ProfilePictureRepository.cs @@ -0,0 +1,25 @@ +using System.Threading.Tasks; +using DevHive.Data.Interfaces; +using DevHive.Data.Models; +using Microsoft.EntityFrameworkCore; + +namespace DevHive.Data.Repositories +{ + public class ProfilePictureRepository : BaseRepository<ProfilePicture>, IProfilePictureRepository + { + private readonly DevHiveContext _context; + + public ProfilePictureRepository(DevHiveContext context) + : base(context) + { + this._context = context; + } + + public async Task<ProfilePicture> GetByURLAsync(string picUrl) + { + return await this._context + .ProfilePicture + .FirstOrDefaultAsync(x => x.PictureURL == picUrl); + } + } +} |
