/// <summary>
        /// Create a new facility object.
        /// </summary>
        /// <param name="id">Initial value of the id property.</param>
        /// <param name="user_id">Initial value of the user_id property.</param>
        /// <param name="name">Initial value of the name property.</param>
        /// <param name="add_date">Initial value of the add_date property.</param>
        public static facility Createfacility(global::System.Int32 id, global::System.Guid user_id, global::System.String name, global::System.DateTime add_date)
        {
            facility facility = new facility();

            facility.id       = id;
            facility.user_id  = user_id;
            facility.name     = name;
            facility.add_date = add_date;
            return(facility);
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the facilities EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTofacilities(facility facility)
 {
     base.AddObject("facilities", facility);
 }
        // POST api/Facility
        public HttpResponseMessage Postfacility(facility facility)
        {
            if (ModelState.IsValid)
            {
                db.facilities.AddObject(facility);
                db.SaveChanges();

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, facility);
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = facility.id }));
                return response;
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
        // PUT api/Facility/5
        public HttpResponseMessage Putfacility(int id, facility facility)
        {
            if (ModelState.IsValid && id == facility.id)
            {
                db.facilities.Attach(facility);
                db.ObjectStateManager.ChangeObjectState(facility, EntityState.Modified);

                try
                {
                    db.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    return Request.CreateResponse(HttpStatusCode.NotFound);
                }

                return Request.CreateResponse(HttpStatusCode.OK);
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
 /// <summary>
 /// Create a new facility object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="user_id">Initial value of the user_id property.</param>
 /// <param name="name">Initial value of the name property.</param>
 /// <param name="add_date">Initial value of the add_date property.</param>
 public static facility Createfacility(global::System.Int32 id, global::System.Guid user_id, global::System.String name, global::System.DateTime add_date)
 {
     facility facility = new facility();
     facility.id = id;
     facility.user_id = user_id;
     facility.name = name;
     facility.add_date = add_date;
     return facility;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the facilities EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTofacilities(facility facility)
 {
     base.AddObject("facilities", facility);
 }