Beispiel #1
0
        public override void Execute(LokiContext storage)
        {
            var resource = storage.Resources.FirstOrDefault(x => x.Culture == _culture && x.Set == _set && x.Key == _key);
            if (resource != null)
            {
                resource.Value = _value;
            }
            else
            {
                resource = new Resource {Culture = _culture, Key = _key, Set = _set, Value = _value};

                storage.Resources.Add(resource);
            }

            storage.SaveChanges();
        }
Beispiel #2
0
        public override void Execute(LokiContext storage)
        {
            var resources = storage.Resources.Where(x => x.Culture == _culture && x.Set == _set && x.Key == _key).ToArray();
            if (resources.Length == 0)
            {
                return;
            }

            storage.Resources.RemoveRange(resources);
            storage.SaveChanges();
        }