Пример #1
0
        public IEnumerable <Domain.Coin.CoinArticel.CoinArticel> GetNews(CoinArticelInputDto input)
        {
            var data = Db.Database.SqlQuery <Domain.Coin.CoinArticel.CoinArticel>($"select Title,Author,Logo,Id,CreateTime from CoinArticel where Category={input.Category} and IsDelete=0 ORDER BY CreateTime desc");

            return(data?.Skip(input.pagesize * (input.pageindex > 1 ? input.pageindex - 1 : 0)).Take(input.pagesize));
        }
Пример #2
0
        public IActionResult GetList([FromQuery] CoinArticelInputDto input)
        {
            var result = _service.GetListCoinArticel(input);

            return(PageResponse(result));
        }
Пример #3
0
        public IActionResult GetNews([FromQuery] CoinArticelInputDto input)
        {
            var result = _service.GetNews(input);

            return(ApiResponse(result));
        }
Пример #4
0
 public IActionResult AddCoinArticel([FromBody] CoinArticelInputDto input)
 {
     _service.AddCoinArticel(input);
     return(AddResponse(input));
 }