Example #1
0
 public bool Delete(Parameter item)
 {
     if (item != null)
     {
         this.dbContext.Parameters.Remove(item);
         this.dbContext.SaveChanges();
         return true;
     }
     return false;
 }
Example #2
0
        public int Parameter(string key, string value)
        {
            Parameter test = this.repo.GetByKey(key);
            if (test != null)
            {
                return test.Id;
            }

            Parameter item = new Parameter()
            {
                Key = key,
                Value = value

            };
            int createdId = this.repo.Create(item);

            return createdId;
        }
Example #3
0
 private bool SaveChanges(Parameter item)
 {
     return this.repo.SaveChanges(item);
 }
Example #4
0
 public bool SaveChanges(Parameter item)
 {
     this.dbContext.Entry(item).State = System.Data.Entity.EntityState.Modified;
     int result = this.dbContext.SaveChanges();
     return result > 0;
 }
Example #5
0
 public int Create(Parameter item)
 {
     this.dbContext.Parameters.Add(item);
     this.dbContext.SaveChanges();
     return item.Id;
 }