/// <summary> /// Create a new List with new instances of ParcelEvaluations. /// </summary> /// <param name="context"></param> /// <param name="parcel"></param> /// <param name="startDate"></param> /// <param name="count"></param> /// <param name="key"></param> /// <param name="value"></param> /// <returns></returns> public static List <Entity.ParcelEvaluation> CreateEvaluations(this PimsContext context, Entity.Parcel parcel, DateTime startDate, int count, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1) { var evaluations = new List <Entity.ParcelEvaluation>(count); for (var i = 0; i < count; i++) { evaluations.Add(context.CreateEvaluation(parcel, startDate.AddYears(i), key, value)); } return(evaluations); }
/// <summary> /// Create a new List with new instances of BuildingEvaluations. /// </summary> /// <param name="context"></param> /// <param name="building"></param> /// <param name="dates"></param> /// <param name="key"></param> /// <param name="value"></param> /// <returns></returns> public static List <Entity.BuildingEvaluation> CreateEvaluations(this PimsContext context, Entity.Building building, DateTime[] dates, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1) { var evaluations = new List <Entity.BuildingEvaluation>(dates.Length); foreach (var date in dates) { evaluations.Add(context.CreateEvaluation(building, date, key, value)); } return(evaluations); }