コード例 #1
0
        public void Update(T entity)
        {
            MBTIEntities context = CreateContext();

            context.Entry(entity).State = EntityState.Modified;
            context.SaveChanges();
        }
コード例 #2
0
        public void Delete(T entity)
        {
            MBTIEntities context = CreateContext();

            context.Entry(entity).State = EntityState.Deleted;
            context.SaveChanges();
        }
コード例 #3
0
        public void Insert(T entity)
        {
            MBTIEntities context = CreateContext();

            context.Entry(entity).State = EntityState.Added;

            context.SaveChanges();
        }