public JsonResult TopJugador() { try { IBusquedaBusiness business = DependencyFactory.Resolve <IBusquedaBusiness>(); var result = business.TopJugador(); result.ForEach(o => o.Link = #if DEBUG "http://localhost:52771/#!/ProfilePublic/JugadorPublic/" + o.Id.ToString() #else "http://allwiners.com/#!/ProfilePublic/JugadorPublic/" + o.Id.ToString() #endif ); Response.StatusCode = 200; return(new JsonResult { Data = result, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } catch (Exception) { Response.StatusCode = 500; return(new JsonResult { Data = "Error de servidor", JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } }
public void Top() { //Fichajes[rnd.Next(0, 2)], Perfiles[rnd.Next(0, 2)] var list = busqueda.TopJugador(); Console.WriteLine(list.SerializarToJson()); //} }
public List <JugadorViewModel> TopJugador() { try { IBusquedaBusiness business = DependencyFactory.Resolve <IBusquedaBusiness>(); var result = business.TopJugador(); result.ForEach(o => o.Link = #if DEBUG "http://localhost:52771/#!/ProfilePublic/JugadorPublic/" + o.Id.ToString() #else "http://allwiners.com/#!/ProfilePublic/JugadorPublic/" + o.Id.ToString() #endif ); return(result); } catch (Exception) { throw new Exception("Error de servidor"); } }