/// <summary> /// Gets the valid entity of type T /// </summary> /// <param name="counter">The counter.</param> /// <returns>A valid entity of type T</returns> protected override Notification GetValid(int?counter) { var rtValue = CreateValidEntities.Notification(counter); var userToGet = counter.HasValue && counter.Value <= 5 ? counter.Value.ToString() : "1"; rtValue.User = UserRepository.Queryable.Single(a => a.Id == userToGet); if (counter.HasValue && counter.Value == 3) { rtValue.Weekly = true; } else { rtValue.Weekly = false; } return(rtValue); }