private static DomainAdditionOptions GetOptions(string[] args) { var options = ContractorOptionsLoader.Load(Directory.GetCurrentDirectory()); var domainOptions = new DomainAdditionOptions(options) { Domain = args[2] }; domainOptions.Domain = domainOptions.Domain.UpperFirstChar(); return(domainOptions); }
public void AddDomain(IDomainAdditionOptions options) { if (!DomainAdditionOptions.Validate(options)) { throw new OptionValidationException("Die Optionen sind nicht korrekt formatiert."); } foreach (ClassGeneration classGeneration in classGenerations) { classGeneration.PerformAddDomainCommand(options); } }
public static void Perform(string[] args) { if (args.Length < 3) { Console.WriteLine("Bitte geben sie einen Domain Name an. Beispiel: contractor add domain Bankwesen"); return; } DomainAdditionOptions domainOptions = GetOptions(args); AddDomain(domainOptions); }
private static void AddBanken(ContractorOptions contractorOptions) { ContractorCoreApi contractorCoreApi = new ContractorCoreApi(); // Domain var domainAdditionOptions = new DomainAdditionOptions(contractorOptions) { Domain = "GegönntesBankwesen" }; contractorCoreApi.AddDomain(domainAdditionOptions); // Entities EntityAdditionOptions entityAdditionOptions = new EntityAdditionOptions(domainAdditionOptions) { EntityName = "GegönnteBank", EntityNamePlural = "GegönnteBanken" }; contractorCoreApi.AddEntity(entityAdditionOptions); // Properties PropertyAdditionOptions propertyAdditionOptions = new PropertyAdditionOptions(entityAdditionOptions) { PropertyType = PropertyTypes.String, PropertyName = "Name", PropertyTypeExtra = "256" }; contractorCoreApi.AddProperty(propertyAdditionOptions); propertyAdditionOptions = new PropertyAdditionOptions(entityAdditionOptions) { PropertyType = PropertyTypes.String, PropertyName = "GegönnterName", PropertyTypeExtra = "256" }; contractorCoreApi.AddProperty(propertyAdditionOptions); propertyAdditionOptions = new PropertyAdditionOptions(entityAdditionOptions) { PropertyType = PropertyTypes.Boolean, PropertyName = "GegönnterBoolean" }; contractorCoreApi.AddProperty(propertyAdditionOptions); propertyAdditionOptions = new PropertyAdditionOptions(entityAdditionOptions) { PropertyType = PropertyTypes.DateTime, PropertyName = "GegönntesDateTime", }; contractorCoreApi.AddProperty(propertyAdditionOptions); propertyAdditionOptions = new PropertyAdditionOptions(entityAdditionOptions) { PropertyType = PropertyTypes.Double, PropertyName = "GegönnterDouble" }; contractorCoreApi.AddProperty(propertyAdditionOptions); propertyAdditionOptions = new PropertyAdditionOptions(entityAdditionOptions) { PropertyType = PropertyTypes.Guid, PropertyName = "GegönnteGuid", }; contractorCoreApi.AddProperty(propertyAdditionOptions); propertyAdditionOptions = new PropertyAdditionOptions(entityAdditionOptions) { PropertyType = PropertyTypes.Integer, PropertyName = "GegönnterInteger" }; contractorCoreApi.AddProperty(propertyAdditionOptions); }