コード例 #1
0
        public AllSpeciesResponse getAll()
        {
            try
            {
                var response = new AllSpeciesResponse();
                var bc       = new SpecieComponent();
                response.Result = bc.ToList();

                return(response);
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };
                throw new HttpResponseException(httpError);
            }
        }
コード例 #2
0
 // GET: MiEspecie
 public ActionResult Index()
 {
     return(View(db.ToList()));
 }
コード例 #3
0
        public ActionResult Index()
        {
            var especies = db.ToList();

            return(View(especies));
        }
コード例 #4
0
 public ActionResult Index2()
 {
     ViewBag.Clients = new SelectList(dbClient.ToList(), "Id", "Name");
     ViewBag.Species = new SelectList(dbSpecie.ToList(), "Id", "Nombre");
     return View();
 }
コード例 #5
0
        public List <Species> ToList()
        {
            var especies = bs.ToList();

            return(especies);
        }