コード例 #1
0
        public ChangeSetModel CreateChangeSet(ChangeSetModel model)
        {
            try
            {
                var ChangeSet = new ChangeSet()
                {
                    id          = Guid.NewGuid(),
                    shortName   = model.shortName,
                    edition     = model.edition,
                    addition    = model.addition,
                    deletion    = model.deletion,
                    description = model.description,
                    trackerId   = model.trackerId,
                    parent      = model.parent,
                    stamp       = model.stamp,
                    origin      = model.origin
                };

                entities.ChangeSet.Add(ChangeSet);
                entities.SaveChanges();
                model.id = ChangeSet.id;
                return(model);
            }
            catch
            {
                return(null);
            }
        }
コード例 #2
0
 public bool DeleteChangeSet(ChangeSetModel model)
 {
     try
     {
         entities.ChangeSet.Remove(entities.ChangeSet.Single(record => record.id.Equals(model.id)));
         entities.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }