예제 #1
0
        /// <summary>
        /// Create a new instance of a ParcelEvaluations.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="parcel"></param>
        /// <param name="date"></param>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public static Entity.ParcelEvaluation CreateEvaluation(this PimsContext context, Entity.Parcel parcel, DateTime date, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1)
        {
            var evaluation = CreateEvaluation(parcel, date, key, value);

            context.ParcelEvaluations.Add(evaluation);
            return(evaluation);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 /// <summary>
 /// Create a new instance of a ParcelEvaluations.
 /// </summary>
 /// <param name="parcel"></param>
 /// <param name="date"></param>
 /// <param name="key"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public static Entity.ParcelEvaluation CreateEvaluation(Entity.Parcel parcel, DateTime date, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1)
 {
     return(new Entity.ParcelEvaluation()
     {
         ParcelId = parcel.Id,
         Parcel = parcel,
         Date = date,
         Key = key,
         Value = value,
         CreatedById = Guid.NewGuid(),
         CreatedOn = DateTime.UtcNow,
         RowVersion = new byte[] { 12, 13, 14 }
     });
 }
예제 #4
0
 /// <summary>
 /// Create a new List with new instances of ParcelEvaluations.
 /// </summary>
 /// <param name="parcel"></param>
 /// <param name="startDate"></param>
 /// <param name="count"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public static List <Entity.ParcelEvaluation> CreateEvaluations(Entity.Parcel parcel, DateTime startDate, int count, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1)
 {
     for (var i = 0; i < count; i++)
     {
         parcel.Evaluations.Add(CreateEvaluation(parcel, startDate.AddYears(i), key, value));
     }
     return(parcel.Evaluations as List <Entity.ParcelEvaluation>);
 }
예제 #5
0
        /// <summary>
        /// Create a new instance of a BuildingEvaluations.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="building"></param>
        /// <param name="date"></param>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public static Entity.BuildingEvaluation CreateEvaluation(this PimsContext context, Entity.Building building, DateTime date, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1)
        {
            var evaluation = CreateEvaluation(building, date, key, value);

            context.BuildingEvaluations.Add(evaluation);
            return(evaluation);
        }
예제 #6
0
 /// <summary>
 /// Create a new List with new instances of BuildingEvaluations.
 /// </summary>
 /// <param name="building"></param>
 /// <param name="dates"></param>
 /// <param name="key"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public static List <Entity.BuildingEvaluation> CreateEvaluations(Entity.Building building, DateTime[] dates, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1)
 {
     foreach (var date in dates)
     {
         building.Evaluations.Add(CreateEvaluation(building, date, key, value));
     }
     return(building.Evaluations as List <Entity.BuildingEvaluation>);
 }
예제 #7
0
 /// <summary>
 /// Create a new List with new instances of BuildingEvaluations.
 /// </summary>
 /// <param name="building"></param>
 /// <param name="startDate"></param>
 /// <param name="count"></param>
 /// <param name="key"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public static List <Entity.BuildingEvaluation> CreateEvaluations(Entity.Building building, DateTime startDate, int count, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1)
 {
     for (var i = 0; i < count; i++)
     {
         building.Evaluations.Add(CreateEvaluation(building, startDate.AddYears(i), key, value));
     }
     return(building.Evaluations as List <Entity.BuildingEvaluation>);
 }
예제 #8
0
 /// <summary>
 /// Create a new instance of a BuildingEvaluations.
 /// </summary>
 /// <param name="building"></param>
 /// <param name="date"></param>
 /// <param name="key"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public static Entity.BuildingEvaluation CreateEvaluation(Entity.Building building, DateTime date, Entity.EvaluationKeys key = Entity.EvaluationKeys.Assessed, decimal value = 1)
 {
     return(new Entity.BuildingEvaluation()
     {
         BuildingId = building.Id,
         Building = building,
         Date = date,
         Key = key,
         Value = value,
         CreatedById = Guid.NewGuid(),
         CreatedOn = DateTime.UtcNow,
         RowVersion = new byte[] { 12, 13, 14 }
     });
 }
예제 #9
0
        /// <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);
        }