Пример #1
0
        /// <summary>
        /// Saves (insert or updates) a place
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public static Place Save(Place p)
        {
            using (EntityContext ctx = new EntityContext())
            {
                p.ValidateAndRaise();

                if (p.PlaceId == 0)
                {
                    ctx.Places.AddObject(p);
                }

                ctx.SaveChanges();

                return p;
            }
        }
Пример #2
0
 partial void DeletePlace(Place instance);
Пример #3
0
 partial void UpdatePlace(Place instance);
Пример #4
0
 partial void InsertPlace(Place instance);
Пример #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Places EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPlaces(Place place)
 {
     base.AddObject("Places", place);
 }
Пример #6
0
 /// <summary>
 /// Create a new Place object.
 /// </summary>
 /// <param name="placeId">Initial value of the PlaceId property.</param>
 public static Place CreatePlace(global::System.Int32 placeId)
 {
     Place place = new Place();
     place.PlaceId = placeId;
     return place;
 }