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) }); }
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) }); }
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); }
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); }