예제 #1
0
        public void UpdatePlatform(Platform platform)
        {
            CheckDbState();
            Platform oldData;

            lock (fileLock)
            {
                oldData = PlatformsCollection.FindById(platform.Id);
                PlatformsCollection.Update(platform);
            }

            OnPlatformUpdated(new List <PlatformUpdateEvent>()
            {
                new PlatformUpdateEvent(oldData, platform)
            });
        }
예제 #2
0
        public void UpdatePlatform(Platform platform)
        {
            CheckDbState();
            Platform oldData;

            using (Database.Engine.Locker.Reserved())
            {
                oldData = PlatformsCollection.FindById(platform.Id);
                PlatformsCollection.Update(platform);
            }

            OnPlatformUpdated(new List <PlatformUpdateEvent>()
            {
                new PlatformUpdateEvent(oldData, platform)
            });
        }
예제 #3
0
        public void UpdatePlatform(List <Platform> platforms)
        {
            CheckDbState();
            var updates = new List <PlatformUpdateEvent>();

            lock (fileLock)
            {
                foreach (var platform in platforms)
                {
                    var oldData = PlatformsCollection.FindById(platform.Id);
                    PlatformsCollection.Update(platform);

                    updates.Add(new PlatformUpdateEvent(oldData, platform));
                }
            }

            OnPlatformUpdated(updates);
        }
예제 #4
0
        public void UpdatePlatform(List <Platform> platforms)
        {
            CheckDbState();
            var updates = new List <PlatformUpdateEvent>();

            using (Database.Engine.Locker.Reserved())
            {
                foreach (var platform in platforms)
                {
                    var oldData = PlatformsCollection.FindById(platform.Id);
                    PlatformsCollection.Update(platform);

                    updates.Add(new PlatformUpdateEvent(oldData, platform));
                }
            }

            OnPlatformUpdated(updates);
        }