public Week(YearWeek yearWeek, string alias) { this.PartitionKey = yearWeek.ToString(); this.RowKey = alias; this.Year = yearWeek.Year; this.WeekNumber = yearWeek.Week; this.WeekEndDate = DateUtilities.DateOfWeek(yearWeek); this.Alias = alias; }
public static IEnumerable<Week> GetWeekAll(YearWeek yearWeek) { // Create the CloudTable object that represents the table. CloudTable table = _tableClient.GetTableReference("week"); table.CreateIfNotExists(); var weeks = from result in table.CreateQuery<Week>() where result.PartitionKey == string.Format("{0}_{1}", yearWeek.Year, yearWeek.Week) select result; return weeks; }
public static Week GetWeek(YearWeek yearWeek, string person) { // Create the CloudTable object that represents the table. CloudTable table = _tableClient.GetTableReference("week"); table.CreateIfNotExists(); var week = from result in table.CreateQuery<Week>() where result.PartitionKey == string.Format("{0}_{1}", yearWeek.Year, yearWeek.Week) && result.RowKey == person select result; return week.FirstOrDefault(); }
public static DateTime DateOfWeek(YearWeek yearWeek) { return DateOfWeek(yearWeek.Year, yearWeek.Week); }