public virtual void Remove(File file)
 {
     try
     {
         db.Files.DeleteOnSubmit(file);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 public virtual void Create(File file)
 {
     try
     {
         this.db.Files.InsertOnSubmit(file);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 public virtual void Update(File file)
 {
     try
     {
         File FileOld = this.GetById(file.ID);
         FileOld = file;
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 partial void DeleteFile(File instance);
 partial void UpdateFile(File instance);
 partial void InsertFile(File instance);
		private void detach_Files(File entity)
		{
			this.SendPropertyChanging();
			entity.Upload = null;
		}
		private void attach_Files(File entity)
		{
			this.SendPropertyChanging();
			entity.Upload = this;
		}
 public virtual int Delete(File file)
 {
     try
     {
         //File.IsDelete = true;
         db.SubmitChanges();
         return 0;
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }