示例#1
0
            public static JourneyMapEntity Create(JourneyEntity journey, FeatureEntity feature, DateTime on, string createdBy)
            {
                var entity = new JourneyMapEntity()
                {
                    Journey    = journey,
                    Feature    = feature,
                    CreatedBy  = createdBy,
                    ModifiedBy = createdBy,
                    CreatedOn  = on,
                    ModifiedOn = on
                };

                if (journey.ProductId != feature.ProductId)
                {
                    throw new InvalidStateException("journey and feature must be come from same product");
                }

                entity.Validate();

                return(entity);
            }
示例#2
0
            public static JourneyEntity Create(string name, DateTime on, string user, ProductEntity product)
            {
                var entity = new JourneyEntity()
                {
                    Name            = name,
                    AvailabilitySlo = 0.99m,
                    AvailabilitySla = 0.99m,
                    ExperienceSlo   = 0.99m,
                    LatencySla      = 1000m,
                    LatencySlo      = 1000m,
                    Avatar          = "https://cdn4.iconfinder.com/data/icons/pretty-office-part-7-reflection-style/256/Cup-gold.png",
                    CreatedBy       = user,
                    ModifiedBy      = user,
                    CreatedOn       = on,
                    ModifiedOn      = on,
                    Product         = product,

                    Group = "Default"
                };

                entity.Validate();
                return(entity);
            }
示例#3
0
 public void AddJourney(JourneyEntity entity)
 {
     entity.Product = this;
     this.Journeys.Add(entity);
 }