コード例 #1
0
ファイル: TagDAO.cs プロジェクト: diogofdsilva/OneCent4World
        public Tag Add(Tag entity)
        {
            if (entity.Id > 0) return entity;

            context.Tag.AddObject(entity);

            try
            {
                context.SaveChanges();
            }
            catch (OptimisticConcurrencyException e)
            {
                //An optimistic concurrency violation has occurred in the data source.
                throw new ConcurrencyException(e.Message);
            }

            return entity;
        }
コード例 #2
0
ファイル: TagDAO.cs プロジェクト: diogofdsilva/OneCent4World
 public Tag Update(Tag entity)
 {
     return entity;
 }
コード例 #3
0
ファイル: TagDAO.cs プロジェクト: diogofdsilva/OneCent4World
 public void Delete(Tag entity)
 {
     context.DeleteObject(entity);
 }