Ejemplo n.º 1
0
        public TemplateConfig AddTemplateconfig(TemplateConfigAddCommand command)
        {
            if (TemplateConfigs == null)
            {
                TemplateConfigs = new List <TemplateConfig>();
            }
            TemplateConfig templateConfig = new TemplateConfig();

            templateConfig.Init(command);
            TemplateConfigs.Add(templateConfig);

            AddEvent(ToAddOrChangeCacheEvent());
            return(templateConfig);
        }
Ejemplo n.º 2
0
        public TemplateConfig RemoveTemplateconfig(TemplateConfigRemoveCommand command)
        {
            if (TemplateConfigs == null)
            {
                TemplateConfigs = new List <TemplateConfig>();
            }
            TemplateConfig templateConfig = TemplateConfigs.FirstOrDefault(p => p.Id == command.Id);

            if (templateConfig == null)
            {
                throw new Exception("TemplateConfig not found");
            }
            templateConfig.Remove(command);

            AddEvent(ToAddOrChangeCacheEvent());
            return(templateConfig);
        }