public ActionResult <IEnumerable <TransmissionShow> > Get([FromQuery] TransmissionSearch query)
 {
     try
     {
         return(Ok(_getS.Execute(query)));
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(StatusCode(500));
     }
 }
Beispiel #2
0
        public IEnumerable <TransmissionShow> Execute(TransmissionSearch request)
        {
            var trans = Context.Transmissions.AsQueryable();

            if (request.Type != null)
            {
                trans.Where(t => t.Type.ToLower() == request.Type.ToLower());
            }
            return(trans.Select(t => new TransmissionShow
            {
                Id = t.Id,
                Type = t.Type
            }));
        }