예제 #1
0
        public bool AddIfKeyNotExist(string key, string value)
        {
            if (!HasKey(key))
            {
                var dicItem = new MyDictionary()
                {
                    Key   = key,
                    Value = value
                };
                _dbContext.Dictionary.Add(dicItem);
                _dbContext.SaveChanges();
                return(true);
            }

            return(false);
        }
예제 #2
0
 public void InsertMailList(MailList[] list)
 {
     _dbContext.MailLists.AddRange(list);
     _dbContext.SaveChanges();
 }