public StravaActivityController(Database db, StravaApi stravaApi, DarkSkyApi darkSkyApi, ILogger <StravaActivityController> logger)
 {
     this.logger     = logger;
     this.db         = db;
     this.stravaApi  = stravaApi;
     this.darkSkyApi = darkSkyApi;
 }
Esempio n. 2
0
        /// <summary>
        /// Retrieves an Effort by id.
        /// </summary>
        /// <param name="id"></param>
        /// <returns>The Effort.</returns>
        public static Effort ById(long id)
        {
            var stravaEffortResponse = StravaApi.Call(string.Format("efforts/{0}", id));

            if (stravaEffortResponse == null)
            {
                return(null);
            }

            return(new Effort(stravaEffortResponse.effort));
        }