Example #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;
            }
        }
Example #2
0
 partial void DeletePlace(Place instance);
Example #3
0
 partial void UpdatePlace(Place instance);
Example #4
0
 partial void InsertPlace(Place instance);
 /// <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);
 }
 /// <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;
 }