public void Add(CourtConfiguration courtConfiguration)
        {
            var courtConfigurationEntity = new CourtConfigurationEntity
            {
                CourtId = courtConfiguration.Court.Id,
                StartHour = courtConfiguration.StartHour,
                EndHour = courtConfiguration.EndHour,
                Days = CourtConfigurationLogic.GetDays(courtConfiguration.Days),
                Price = courtConfiguration.Price,
                Order = courtConfiguration.Order,
                StartDate = courtConfiguration.StartDate,
                EndDate = courtConfiguration.EndDate,
            };

            _context.CourtConfigurations.AddObject(courtConfigurationEntity);
            _context.SaveChanges();

            courtConfiguration.Id = courtConfigurationEntity.Id;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the CourtConfigurations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCourtConfigurations(CourtConfigurationEntity courtConfigurationEntity)
 {
     base.AddObject("CourtConfigurations", courtConfigurationEntity);
 }
 /// <summary>
 /// Create a new CourtConfigurationEntity object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="courtId">Initial value of the CourtId property.</param>
 /// <param name="price">Initial value of the Price property.</param>
 /// <param name="order">Initial value of the Order property.</param>
 public static CourtConfigurationEntity CreateCourtConfigurationEntity(global::System.Int32 id, global::System.Int32 courtId, global::System.Decimal price, global::System.Byte order)
 {
     CourtConfigurationEntity courtConfigurationEntity = new CourtConfigurationEntity();
     courtConfigurationEntity.Id = id;
     courtConfigurationEntity.CourtId = courtId;
     courtConfigurationEntity.Price = price;
     courtConfigurationEntity.Order = order;
     return courtConfigurationEntity;
 }
        public void Update(CourtConfiguration courtConfiguration)
        {
            var courtConfigurationEntity = _context.CourtConfigurations.First(cc => cc.Id == courtConfiguration.Id);

            courtConfigurationEntity = new CourtConfigurationEntity
            {
                Id = courtConfiguration.Id,
                CourtId = courtConfiguration.Court.Id,
                StartHour = courtConfiguration.StartHour,
                EndHour = courtConfiguration.EndHour,
                Days = CourtConfigurationLogic.GetDays(courtConfiguration.Days),
                Price = courtConfiguration.Price,
                Order = courtConfiguration.Order,
                StartDate = courtConfiguration.StartDate,
                EndDate = courtConfiguration.EndDate,
            };

            _context.SaveChanges();
        }