Ejemplo n.º 1
0
 public async Task <List <ReplayPixelModel> > GetPixels(ReplayFilterModel model)
 {
     using (var context = DataContextFactory.CreateReadOnlyContext())
     {
         return(await context.PixelHistory
                .Where(x => x.GameId == model.GameId && x.Type == Enums.PixelType.User && (string.IsNullOrEmpty(model.Player) || x.User.UserName == model.Player))
                .Select(x => new ReplayPixelModel
         {
             Id = x.Id,
             X = x.Pixel.X,
             Y = x.Pixel.Y,
             Color = x.Color
         })
                .OrderBy(x => x.Id)
                .ToListAsync());
     }
 }
Ejemplo n.º 2
0
 public async Task <ActionResult> GetPixels(ReplayFilterModel model)
 {
     return(Json(await ReplayReader.GetPixels(model), JsonRequestBehavior.AllowGet));
 }