public IActionResult GetColorsForAdmin([FromQuery] ColorParams colorParams) { try { var colors = _repo.GetColors(colorParams); Response.AddPagination(colors.CurrentPage, colors.PageSize, colors.TotalCount, colors.TotalPages); return(Ok(colors)); } catch (Exception ex) { return(BadRequest("Κάτι πήγε στραβά")); } }
public void SetColorParam(ColorParams param, double value) { clrParams[(int)param] = value; if (param == ColorParams.Saturation) { Saturation = clrParams[(int)ColorParams.Saturation]; } else { UpdateColorLut(); } }
public SetColor(string color, bool expectReply = false) { Name = "setColor"; if (expectReply) { Params = new ColorReplyParams() { Color = color, ExpectReply = expectReply } } ; else { Params = new ColorParams() { Color = color } }; }
public PagedList <Color> GetColors(ColorParams colorParams) { var colors = _ctx.Color.OrderBy(x => x.Title); return(PagedList <Color> .Create(colors, colorParams.PageNumber, colorParams.PageSize)); }