Esempio n. 1
0
        public IEnumerable <Band> GetAll(
            [FromQuery] string name  = "",
            [FromQuery] string genre = "",
            [FromQuery] int rating   = -1,
            [FromQuery] int cost     = -1
            )
        {
            if (name != "")
            {
                return(GetBandByName(name));
            }
            if (genre != "")
            {
                return(Genre(genre));
            }
            if (rating > -1)
            {
                return(Rating(rating));
            }
            if (cost > -1)
            {
                return(Cost(cost));
            }

            return(Neo4jBand.GetAllBands());
        }
Esempio n. 2
0
        public async Task <IActionResult> CreateAsync(
            [FromBody] BandPost postBand
            )
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await Neo4jBand.AddBandAsync(
                postBand.band, postBand.genres, postBand.members);

            return(CreatedAtAction(nameof(GetBandByName),
                                   new { name = postBand.band.Name }, postBand.band));
        }
Esempio n. 3
0
 public IEnumerable <Band> Cost(int cost)
 {
     return(Neo4jBand.GetBandsByCost(cost));
 }
Esempio n. 4
0
 public IEnumerable <Band> Genre(string genre)
 {
     return(Neo4jBand.GetBandsByGenre(genre));
 }
Esempio n. 5
0
 public IEnumerable <Band> Rating(int rating)
 {
     return(Neo4jBand.GetBandsByRating(rating));
 }
Esempio n. 6
0
 public IEnumerable <Band> GetBandByName(string name)
 {
     return(Neo4jBand.GetBandsByName(name));
 }