예제 #1
0
        public IEnumerable <Venue> GetAll(
            [FromQuery] string name     = "",
            [FromQuery] string genre    = "",
            [FromQuery] int capacity    = -1,
            [FromQuery] string location = ""
            )
        {
            if (name != "")
            {
                return(GetVenueByName(name));
            }
            if (genre != "")
            {
                return(Genre(genre));
            }
            if (capacity > -1)
            {
                return(Capacity(capacity));
            }
            if (location != "")
            {
                return(Location(location));
            }

            return(Neo4jVenue.GetAllVenues());
        }
예제 #2
0
        public async Task <IActionResult> CreateAsync(
            [FromBody] VenuePost postVenue
            )
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await Neo4jVenue.AddVenueAsync(
                postVenue.venue, postVenue.genres);

            return(CreatedAtAction(nameof(GetVenueByName),
                                   new { name = postVenue.venue.Name }, postVenue.venue));
        }
예제 #3
0
 public IEnumerable <Venue> Location(string location)
 {
     return(Neo4jVenue.GetVenuesByLocation(location));
 }
예제 #4
0
 public IEnumerable <Venue> Genre(string genre)
 {
     return(Neo4jVenue.GetVenuesByGenre(genre));
 }
예제 #5
0
 public IEnumerable <Venue> Capacity(int capacity)
 {
     return(Neo4jVenue.GetVenuesByCapacity(capacity));
 }
예제 #6
0
 public IEnumerable <Venue> GetVenueByName(string name)
 {
     return(Neo4jVenue.GetVenuesByName(name));
 }