Ejemplo n.º 1
0
 public static async Task <VideoDb> GetByNameAndUserGuidAsync(AvatarAppContext context, Guid userGuid, string fileName,
                                                              CancellationToken cancellationToken = default)
 {
     return(await context.Videos.FirstOrDefaultAsync(
                video => string.Equals(video.Name, fileName) && video.User.Guid == userGuid,
                cancellationToken));
 }
Ejemplo n.º 2
0
        public void UpdateProperty <TValue>(AvatarAppContext dbContext, string propertyName, TValue value)
        {
            var property = dbContext.Entry(this).Property(propertyName);

            property.CurrentValue = value;
            property.IsModified   = true;
        }
Ejemplo n.º 3
0
        public void UpdateProperty <TEntity, TProperty>(AvatarAppContext dbContext, Expression <Func <TEntity, TProperty> > expression, TProperty value) where TEntity : class, new()
        {
            var source     = new TEntity();
            var idProperty = source.GetType().GetProperty("Id");

            if (idProperty == null)
            {
                return;
            }

            idProperty.SetValue(source, Id);
            var property = dbContext.Entry(source).Property(expression);

            property.CurrentValue = value;
            property.IsModified   = true;
        }
Ejemplo n.º 4
0
 protected EFHandler(AvatarAppContext dbContext)
 {
     DbContext = dbContext;
 }
 public UpdateUserConfirmationHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
 public UpdateVideoFragmentIntervalHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
 public GetBestContestantHandler(AvatarAppContext dbContext, IMapper mapper, IMediator mediator) : base(dbContext, mapper)
 {
     _mediator = mediator;
 }
Ejemplo n.º 8
0
 public UpdateFireBaseHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
Ejemplo n.º 9
0
 public GetGeneralStatisticsHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
Ejemplo n.º 10
0
 public AddFinalistsHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
 public AddSemifinalistHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
 public SetVideoActiveHandler(AvatarAppContext dbContext, IMediator mediator) : base(dbContext)
 {
     _mediator = mediator;
 }
Ejemplo n.º 13
0
 public RemoveVideoHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
 public GetExpiredBattlesHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext, mapper)
 {
 }
Ejemplo n.º 15
0
 public InsertQueryHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext, mapper)
 {
 }
Ejemplo n.º 16
0
 public ToVoteInBattleHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
Ejemplo n.º 17
0
 public GetUncheckedVideosHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext, mapper)
 {
 }
Ejemplo n.º 18
0
 public static async Task <UserDb> GetByGuidAsync(AvatarAppContext context, Guid userGuid)
 {
     return(await context.Users.FirstOrDefaultAsync(user => user.Guid == userGuid));
 }
Ejemplo n.º 19
0
 public GetFinalistsQueryHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext, mapper)
 {
 }
 public GetUserByEmailHandler(AvatarAppContext dbContext, IMediator mediator) : base(dbContext)
 {
     _mediator = mediator;
 }
 public GetUnwatchedVideoQueryHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext, mapper)
 {
 }
Ejemplo n.º 22
0
 public GetUserByGuidHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext, mapper)
 {
 }
Ejemplo n.º 23
0
 public RemoveByIdQueryHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
 public ChangePasswordHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
Ejemplo n.º 25
0
 public UpdateProfilePhotoHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
 protected AutoMapperEFHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext)
 {
     Mapper = mapper;
 }
Ejemplo n.º 27
0
 public CloseBattleHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
Ejemplo n.º 28
0
 public GetLikesNumberHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
 public GetUserIdByGuidHandler(AvatarAppContext dbContext) : base(dbContext)
 {
 }
 public GetLikeNotificationsQueryHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext, mapper)
 {
 }