コード例 #1
0
        private static void Create(RepositoryNoticeContract rep)
        {
            Notice notc1 = rep.Create();
            DbSet<Tags> tagc1 = rep.Create<Tags>();

            Notice notc2 = rep.CreateAndAttach();
            notc2.Active = true;
            notc2.Date = DateTime.Now.Date.AddDays(-30);
            notc2.TagId = 1;
            notc2.Texto = "Texto Create";
            notc2.Title = "Titulo Create";
            int result = rep.Save();
        }
コード例 #2
0
 private static void Delete(RepositoryNoticeContract rep)
 {
     Notice notDelete = rep.CreateAndAttach();
     notDelete.Active = true;
     notDelete.Date = DateTime.Now.Date.AddDays(-30);
     notDelete.TagId = 1;
     notDelete.Texto = "Texto Delete";
     notDelete.Title = "Titulo Delete";
     rep.Save();
     bool result = rep.Delete(notDelete);
 }