Beispiel #1
0
            public void Save(ContinuousSecurity entity)
            {
                entity.CheckExchange();

                if (!Contains(entity))
                {
                    InnerCollection.Add(entity);
                }

                using (var batch = _registry.Storage.BeginBatch())
                {
                    _jumps.RemoveWhere(j => j.Id.ContinuousSecurity == entity.Id);
                    _jumps.AddRange(entity.ExpirationJumps.Select(p => new ContinuousSecurityJump
                    {
                        Id = new ContinuousSecurityId
                        {
                            ContinuousSecurity = entity.Id,
                            JumpSecurity       = p.Key,
                        },
                        JumpDate = p.Value,
                    }));

                    batch.Commit();
                }
            }