private tbTipoBanner CastTipoBanner(TipoBannerEntity TipoBanner) { tbTipoBanner tb = new tbTipoBanner(); tb.DataUltimaAlteracao = TipoBanner.DataUltimaAlteracao; tb.id = TipoBanner.id; tb.Nome = TipoBanner.Nome; tb.responsavelUltimaAlteracao = TipoBanner.responsavelUltimaAlteracao; return(tb); }
public bool DeletaTipoBanner(int id) { try { using (var context = new CirculoNegocioEntities()) { tbTipoBanner delete = (from p in context.tbTipoBanners where p.id == id select p).First(); context.tbTipoBanners.DeleteObject(delete); context.SaveChanges(); } return(true); } catch (Exception) { return(false); } }