/// <summary>
        /// Creates <see cref="MigratorMigrationState"/> from <see cref="MigratorConfigurationState"/>
        /// </summary>
        /// <param name="templateCode">The migrator template code</param>
        /// <param name="state">The state of template</param>
        /// <param name="position">The migration position</param>
        /// <returns>The new <see cref="MigratorTemplateMigrationState"/></returns>
        public static MigratorMigrationState CreateFrom(string templateCode, MigratorConfigurationState state, EnMigratorPosition position)
        {
            if (position != EnMigratorPosition.New && position != EnMigratorPosition.Obsolete)
            {
                throw new ArgumentException(@"Can be called only for new or obsolete templates", nameof(position));
            }

            var resources = state.Resources.Select(r => ResourceMigrationState.CreateFrom(templateCode, state, r, position)).ToList();

            return(new MigratorMigrationState
            {
                Name = state.Name,
                TypeName = state.TypeName,
                Position = position,
                Direction = EnMigrationDirection.Stay,
                DependencyType = state.DependencyType,
                Priority = state.Priority,
                Resources = resources
            });
        }