public NccSettings SetByKey(string key, string value) { var settings = _entityRepository.Query().FirstOrDefault(x => x.Key == key); if (settings != null) { settings.Value = value; _entityRepository.Edit(settings); } else { settings = new NccSettings() { Key = key, Value = value }; _entityRepository.Add(settings); } _entityRepository.SaveChange(); return(settings); }
public NccSettings GetByKey(string key) { return(_entityRepository.Query().FirstOrDefault(x => x.Key == key)); }