Merge branch 'video/50_ImplementarMetodosPersonalizados' into dev
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
using CleanArchitecture.Application.Contracts.Persistence;
|
||||||
|
using CleanArchitecture.Domain;
|
||||||
|
using CleanArchitecture.Infrastructure.Persistence;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CleanArchitecture.Infrastructure.Repositories
|
||||||
|
{
|
||||||
|
public class StreamerRepository: RepositoryBase<Streamer>, IStreamerRepository
|
||||||
|
{
|
||||||
|
public StreamerRepository(StreamerDbContext context) : base(context) { }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using CleanArchitecture.Application.Contracts.Persistence;
|
||||||
|
using CleanArchitecture.Domain;
|
||||||
|
using CleanArchitecture.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace CleanArchitecture.Infrastructure.Repositories
|
||||||
|
{
|
||||||
|
internal class VideoRepository : RepositoryBase<Video>, IVideoRepository
|
||||||
|
{
|
||||||
|
|
||||||
|
public VideoRepository(StreamerDbContext context) : base(context) { }
|
||||||
|
|
||||||
|
public async Task<Video> GetVideoByNombre(string nombreVideo)
|
||||||
|
{
|
||||||
|
return await context.Videos.Where(x => x.Nombre!.Equals(nombreVideo)).SingleOrDefaultAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<IEnumerable<Video>> GetVideoByUserName(string userName)
|
||||||
|
{
|
||||||
|
return await context.Videos.Where(x => x.CreatedBy!.Equals(userName)).ToListAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user