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)); }
public void UpdateProperty <TValue>(AvatarAppContext dbContext, string propertyName, TValue value) { var property = dbContext.Entry(this).Property(propertyName); property.CurrentValue = value; property.IsModified = true; }
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; }
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; }
public UpdateFireBaseHandler(AvatarAppContext dbContext) : base(dbContext) { }
public GetGeneralStatisticsHandler(AvatarAppContext dbContext) : base(dbContext) { }
public AddFinalistsHandler(AvatarAppContext dbContext) : base(dbContext) { }
public AddSemifinalistHandler(AvatarAppContext dbContext) : base(dbContext) { }
public SetVideoActiveHandler(AvatarAppContext dbContext, IMediator mediator) : base(dbContext) { _mediator = mediator; }
public RemoveVideoHandler(AvatarAppContext dbContext) : base(dbContext) { }
public GetExpiredBattlesHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext, mapper) { }
public InsertQueryHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext, mapper) { }
public ToVoteInBattleHandler(AvatarAppContext dbContext) : base(dbContext) { }
public GetUncheckedVideosHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext, mapper) { }
public static async Task <UserDb> GetByGuidAsync(AvatarAppContext context, Guid userGuid) { return(await context.Users.FirstOrDefaultAsync(user => user.Guid == userGuid)); }
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) { }
public GetUserByGuidHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext, mapper) { }
public RemoveByIdQueryHandler(AvatarAppContext dbContext) : base(dbContext) { }
public ChangePasswordHandler(AvatarAppContext dbContext) : base(dbContext) { }
public UpdateProfilePhotoHandler(AvatarAppContext dbContext) : base(dbContext) { }
protected AutoMapperEFHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext) { Mapper = mapper; }
public CloseBattleHandler(AvatarAppContext dbContext) : base(dbContext) { }
public GetLikesNumberHandler(AvatarAppContext dbContext) : base(dbContext) { }
public GetUserIdByGuidHandler(AvatarAppContext dbContext) : base(dbContext) { }
public GetLikeNotificationsQueryHandler(AvatarAppContext dbContext, IMapper mapper) : base(dbContext, mapper) { }