public async Task Update(string id, string title, string description) { await Goals.Where(o => o.Id == id) .Set(o => o.Title, title) .Set(o => o.Description, description) .UpdateAsync(); }
private IEnumerable <Goal> GetGoals(int teamId) { return(Goals .Where(goal => goal.Player.Teams.Select(team => team.Id).Contains(teamId) )); }
private void UpdateAllRelatedGoals() { if (SelectedGoal == null) { AllRelatedGoals = new List <Goal>(); } else { switch (SelectedGoal.GoalType) { case GoalType.LongTerm: AllRelatedGoals = Goals.Where(x => x.GoalType == GoalType.OneYear).ToList(); break; case GoalType.OneYear: AllRelatedGoals = Goals.Where(x => x.GoalType == GoalType.ShortTerm).ToList(); break; case GoalType.ShortTerm: AllRelatedGoals = Goals.Where(x => x.GoalType == GoalType.InitiativesOne).ToList(); break; case GoalType.InitiativesOne: AllRelatedGoals = new List <Goal>(); break; } SelectedGoal.RelatesGoals.ForEach(x => AllRelatedGoals.RemoveAll(y => y.Id == x)); var relatedGoals = new List <Goal>(); SelectedGoal.RelatesGoals.ForEach(x => relatedGoals.Add(Goals.FirstOrDefault(y => y.Id == x))); RelatedGoals = relatedGoals; } }
private int GetScore(int teamId) { return(Goals .Where(goal => goal.Player.Teams.Select(team => team.Id).Contains(teamId) ) .Sum(goal => goal.Count)); }
public Data ToBase() { return(new Data() { gameFinished = GameFinished, Pieces = Pieces?.Where(q => q != null).Select(q => q.ToBase()).ToArray(), playerGuid = PlayerGUID, playerId = PlayerId, PlayerLocation = PlayerLocation?.ToBase(), TaskFields = Tasks?.Where(q => q != null).Select(q => q.ToBase()).ToArray(), GoalFields = Goals?.Where(q => q != null).Select(q => q.ToBase()).ToArray() }); }
/// <summary> /// Transforms from kh list to mental model /// </summary> /// <returns></returns> private List <MentalModel> TransformDOToMentalModel() { mentalProto = DecisionOptions.GroupBy(kh => kh.MentalModel).OrderBy(g => g.Key).Select(g => new MentalModel(g.Key, Goals.Where(goal => MentalModel[g.Key.ToString()].AssociatedWith.Contains(goal.Name)).ToArray(), g.GroupBy(kh => kh.DecisionOptionsLayer).OrderBy(g2 => g2.Key). Select(g2 => new DecisionOptionLayer(MentalModel[g.Key.ToString()].Layer[g2.Key.ToString()], g2)))).ToList(); return(mentalProto); }
public override string ToString() { return(HomeTeam + " (" + Goals.Where(goal => goal.Team == HomeTeam).ToString() + ") " + AwayTeam + " (" + Goals.Where(goal => goal.Team == AwayTeam).ToString() + ")"); }
public async Task SetState(GoalState goalState, params string[] goalIds) { await Goals.Where(o => o.Id.In(goalIds)) .Set(o => o.State, goalState) .UpdateAsync(); }
public async Task SetAssignee(string goalId, string assigneeId) { await Goals.Where(o => o.Id == goalId) .Set(o => o.AssigneeId, assigneeId) .UpdateAsync(); }
//--------------------------------------------------------------------------------------------- public async Task <IEnumerable <Goal> > GetGoalsAsync(int userId) { return(await Goals.Where(g => g.UserId == userId).ToListAsync()); }
internal static IEnumerable <PresentItem> GetGoalPresentation(string groupKey, string memberKey, string parentid) { return(Goals.Where(i => i.GroupKey == groupKey && i.MemberKey == memberKey && i.ParentId == parentid).Select(i => GoalToPresentation(groupKey, memberKey, i))); }
internal static IEnumerable <GoalItem> GetGoal(string groupKey) { return(Goals.Where(m => m.GroupKey == groupKey)); }
/// <summary> /// Transforms from rule list to rule sets /// </summary> /// <returns></returns> private List <RuleSet> TransformRulesToRuleSets() { mentalProto = Rules.GroupBy(r => r.RuleSet).OrderBy(g => g.Key).Select(g => new RuleSet(g.Key, Goals.Where(goal => SetConfiguration[g.Key.ToString()].AssociatedWith.Contains(goal.Name)).ToArray(), g.GroupBy(r => r.RuleLayer).OrderBy(g2 => g2.Key). Select(g2 => new RuleLayer(SetConfiguration[g.Key.ToString()].Layer[g2.Key.ToString()], g2)))).ToList(); return(mentalProto); }
public async Task <string[]> GetIdsByState(GoalState state) { return(await Goals.Where(o => o.State == state) .Select(o => o.Id) .ToArrayAsync()); }
internal static IEnumerable <PresentItem> GetTodos(string groupKey, string memberKey, string parentid) { return(Goals.Where(i => i.GroupKey == groupKey && i.MemberKey == memberKey && !Goals.Any(g => g.ParentId == i.Id)).Select(i => GoalToPresentation2(groupKey, memberKey, i))); }
internal void Init() { Goals.Where(x => !x.Completed).ToList().ForEach(x => x.Init()); }
public List <Goal> GameWeekGoals(int gameWeekId, bool cup = false) { return(Goals.Where(x => x.GameWeekId == gameWeekId && x.Cup == cup).ToList()); }