public IHttpActionResult Get() // get all talents regardless of Id ***does anything go here inside the method?
        {
            TalentService talentService = CreateTalentService();
            var           talents       = talentService.GetAllTalents();

            return(Ok(talents));
        }
        // Get talent by Id .. we can use this to get the talent when making a Gig?
        public IHttpActionResult Get(int id)
        {
            TalentService talentService = CreateTalentService();
            var           talent        = talentService.GetTalentById(id);

            return(Ok(talent));
        }
        // this method allows us to use TalentService in these methods
        private TalentService CreateTalentService()
        {
            var userId        = User.Identity.GetUserId(); // not parsing a Guid...Guid.Parse(User.Identity.GetUserId());
            var talentService = new TalentService(userId);

            return(talentService);
        }
Example #4
0
 public TalentsController(TalentService talentService, LevelService levelService)
 {
     _talentService = talentService;
     _levelService  = levelService;
 }