/// <summary>
        /// Initializes a new instance of the <see cref="SuggestionModule" />.
        /// </summary>
        /// <param name="repository">The suggestion's repository</param>
        public SuggestionModule(IApplication application, ISuggestRepository repository)
            : base(application)
        {
            this._Repository = repository;

            // Define a route for urls "/members/{id}" which will returns the member matching the specified slug
            this.Get["/{id}"] = parameters =>
            {
                return GetSuggestion(parameters.id);
            };

            // Bind the HTTP GET verb to the ListMembers method
            this.Get["/suggestions"] = ListPublicSuggestions;
        }
Ejemplo n.º 2
0
 public SuggestService(ISuggestRepository suggestRepository)
 {
     this._suggestRepository = suggestRepository;
 }
Ejemplo n.º 3
0
 public SuggestService(ISuggestRepository repository, ILogger <SuggestService> logger = null)
 {
     _repository = repository;
     _logger     = logger ?? new NullLogger <SuggestService>();
 }
Ejemplo n.º 4
0
 public SuggestController(ISuggestRepository suggestRepository, ISuggestService suggestService)
 {
     _suggestRepository = suggestRepository;
     _suggestServices   = suggestService;
 }
Ejemplo n.º 5
0
 public SuggestService(ISuggestRepository suggestRepository)
 {
     _suggestRepository = suggestRepository;
 }