public static void Filter(IEnumerable list, RetrievingInfo retrievingInfo) { foreach (var item in list) { var properties = item.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance); foreach (PropertyInfo propertyInfo in properties) { var attributes = propertyInfo.GetCustomAttributes(typeof(FilterAttribute), true); if (attributes.Length > 0) { var filterAttr = (FilterAttribute)attributes[0]; if ((filterAttr.FilterType == FilterType.Image && !retrievingInfo.Images) || (filterAttr.FilterType == FilterType.LongText && !retrievingInfo.LongTexts)) { propertyInfo.SetValue(item, null, null); } } } } }
public WorkoutPlanDTO GetWorkoutPlan(Token token, Guid planId, RetrievingInfo retrievingInfo) { throw new NotImplementedException(); }
public IList <MyTrainingDTO> GetStartedTrainings(Token token, Guid?typeId, RetrievingInfo retrievingInfo) { throw new NotImplementedException(); }
public TrainingDayDTO GetTrainingDay(Token token, WorkoutDayGetOperation operationParams, RetrievingInfo retrievingInfo) { throw new NotImplementedException(); }
public TrainingDayDTO GetTrainingDay(Token token, WorkoutDayGetOperation operationParams, RetrievingInfo retrievingInfo) { return(exceptionHandling(token, () => InternalService.GetTrainingDay(token, operationParams, retrievingInfo))); }
static async public Task <TrainingDayDTO> GetTrainingDayAsync(WorkoutDayGetOperation param, RetrievingInfo retrievingInfo) { var test = exceptionHandling((client) => { return(Task <TrainingDayDTO> .Factory.FromAsync(client.BeginGetTrainingDay, client.EndGetTrainingDay, ApplicationState.Current.SessionData.Token, param, retrievingInfo, null)); }); return(await test); }
public TrainingDayDTO GetTrainingDay(Token token, WorkoutDayGetOperation operationParams, RetrievingInfo retrievingInfo) { var securityInfo = SecurityManager.EnsureAuthentication(token); TrainingDayService service = new TrainingDayService(Session, securityInfo, Configuration, PushNotificationService, EMailService); return(service.GetTrainingDay(operationParams, retrievingInfo)); }