Example #1
0
        public async Task Add(TProjection projection)
        {
            await using var context = new GameSociationContext(_options);
            await context.Set <TProjection>().AddAsync(projection);

            await context.SaveChangesAsync();
        }
Example #2
0
        public async Task Update(Guid projectionId, Action <TProjection> update)
        {
            await using var context = new GameSociationContext(_options);
            var projection = await context.Set <TProjection>().SingleOrDefaultAsync(p => p.Id == projectionId);

            if (projection != null)
            {
                update(projection);
            }

            await context.SaveChangesAsync();
        }
Example #3
0
 public EfUserQueries(GameSociationContext context)
 {
     _context = context;
 }