Example #1
0
        public ActionResult Create(Builder builder)
        {
            if (ModelState.IsValid)
            {
                builder.Id = Guid.NewGuid();
                db.Builders.AddObject(builder);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(builder);
        }
Example #2
0
 public ActionResult Edit(Builder builder)
 {
     if (ModelState.IsValid)
     {
         db.Builders.Attach(builder);
         db.ObjectStateManager.ChangeObjectState(builder, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(builder);
 }
Example #3
0
 /// <summary>
 /// Create a new Builder object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="cityId">Initial value of the CityId property.</param>
 /// <param name="urlId">Initial value of the UrlId property.</param>
 public static Builder CreateBuilder(global::System.Guid id, global::System.String name, global::System.Guid cityId, global::System.String urlId)
 {
     Builder builder = new Builder();
     builder.Id = id;
     builder.Name = name;
     builder.CityId = cityId;
     builder.UrlId = urlId;
     return builder;
 }
Example #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Builders EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBuilders(Builder builder)
 {
     base.AddObject("Builders", builder);
 }