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); }
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); }
public void AddJourney(JourneyEntity entity) { entity.Product = this; this.Journeys.Add(entity); }