Blog.DAL.TagDAL.UsunTagiPostu C# (CSharp) Method

UsunTagiPostu() public method

public UsunTagiPostu ( int idPosta ) : void
idPosta int
return void
        public void UsunTagiPostu(int idPosta)
        {
            using (LinqTodbBlogDataContext db = new LinqTodbBlogDataContext())
            {
                try
                {
                    var lista = from a in db.Tagis where a.id_posta == idPosta select a;
                    db.Tagis.DeleteAllOnSubmit(lista);
                    db.SubmitChanges();
                }
                catch (Exception)
                { throw new Exception("Wystąpił błąd podczas usuwania tagów"); }
            }
        }