Esempio n. 1
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="obj"></param>
		/// <returns></returns>
		public Url Delete(Url obj)
		{
			Url deletedUrl = null;

			using (Entities model = new Entities())
			{
				model.Urls.Attach(obj);
				model.Entry(obj).State = System.Data.Entity.EntityState.Deleted;
				model.SaveChanges();
			}

			return deletedUrl;
		}
Esempio n. 2
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="obj"></param>
		/// <returns></returns>
		public Url Update(Url obj)
		{
			Url url = null;

			using (Entities model = new Entities())
			{
				url = model.Urls.Attach(obj);
				model.Entry(obj).State = System.Data.Entity.EntityState.Modified;
				model.SaveChanges();
			}

			return url;
		}