Code2Gether-Discord / JokesOnYou

A learning project, A jokes website build as a team project.
12 stars 11 forks source link

Add: Jokes search by Filters; #184

Closed HellHunterMax closed 2 years ago

HellHunterMax commented 2 years ago

Easy to add new jokes by adding a new filter with the IFilter interface and adding it to the JokeFiltersDto and adding it in JokesService.

How about this?

Closes: #91

chrisK00 commented 2 years ago

Good idea but there's something very important we need to have a look at We chose to do a sort of N-tier architecture in order to decouple the components from each other, which is another reason we choose repository pattern because we want to abstract away our data access layer.

Whats happening here is that we are providing an expression from another layer as if it were a generic repository pattern.

This could be simplified in to

 class JokesParams
    {
        public string Search { get; set; } //search for any joke that contains the text
        public string AuthorId { get; set; } //search for a specific author's joke
        public int MinLikes { get; set; }
        public int MaxLikes { get; set; } 
    }
HellHunterMax commented 2 years ago

@chrisK00 Thanks for the comments I agree with them and I'll have a look tonight! thanks! learnt a lot from this though!