コード例 #1
0
        public void DeleteResponseQuality(ResponseQualityItem ResponseQualityItem)
        {
            var entity = new ResponseQuality
            {
                ResponseQualityID = ResponseQualityItem.ResponseQualityID
            };

            db.ResponseQualities.Attach(entity);
            db.ResponseQualities.Remove(entity);
            db.SaveChanges();
        }
コード例 #2
0
        public void CreateResponseQuality(ResponseQualityItem ResponseQualityItem)
        {
            var entity = new ResponseQuality
            {
                ResponseQualityName = ResponseQualityItem.ResponseQualityName
            };

            db.ResponseQualities.Add(entity);
            db.SaveChanges();
            ResponseQualityItem.ResponseQualityID = entity.ResponseQualityID;
        }
コード例 #3
0
        public void UpdateResponseQuality(ResponseQualityItem ResponseQualityItem)
        {
            var entity = new ResponseQuality
            {
                ResponseQualityID   = ResponseQualityItem.ResponseQualityID,
                ResponseQualityName = ResponseQualityItem.ResponseQualityName
            };

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