Пример #1
0
 /// <summary>
 /// Create a new List with new instances of Buildings.
 /// Adds the buildings to the specified 'parcel'.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="parcel"></param>
 /// <param name="startId"></param>
 /// <param name="count"></param>
 /// <returns></returns>
 public static List <Entity.Building> CreateBuildings(this PimsContext context, Entity.Parcel parcel, int startId, int count)
 {
     for (var i = startId; i < (startId + count); i++)
     {
         context.CreateBuilding(parcel, i);
     }
     return(parcel.Buildings.Select(pb => pb.Building).ToList());
 }
Пример #2
0
        /// <summary>
        /// Create a new List with new instances of Buildings.
        /// Adds the buildings to the specified 'parcel'.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="parcel"></param>
        /// <param name="startId"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public static List <Entity.Building> CreateBuildings(this PimsContext context, Entity.Parcel parcel, int startId, int count)
        {
            var buildings = new List <Entity.Building>();

            for (var i = startId; i < (startId + count); i++)
            {
                buildings.Add(context.CreateBuilding(parcel, i));
            }
            return(buildings);
        }