Пример #1
0
        public void DeleteIssueCategory(IssueCategoryItem issueCategoryItem)
        {
            var entity = new IssueCategory
            {
                IssueCategoryID = issueCategoryItem.IssueCategoryID
            };

            db.IssueCategorys.Attach(entity);
            db.IssueCategorys.Remove(entity);
            db.SaveChanges();
        }
Пример #2
0
        public void CreateIssueCategory(IssueCategoryItem issueCategoryItem)
        {
            var entity = new IssueCategory
            {
                IssueCategoryName = issueCategoryItem.IssueCategoryName
            };

            db.IssueCategorys.Add(entity);
            db.SaveChanges();
            issueCategoryItem.IssueCategoryID = entity.IssueCategoryID;
        }
Пример #3
0
        public void UpdateIssueCategory(IssueCategoryItem issueCategoryItem)
        {
            var entity = new IssueCategory
            {
                IssueCategoryID   = issueCategoryItem.IssueCategoryID,
                IssueCategoryName = issueCategoryItem.IssueCategoryName
            };

            db.IssueCategorys.Attach(entity);
            db.Entry(entity).State = EntityState.Modified;
            db.SaveChanges();
        }