/// <summary>
        /// Updates the state of the current instance to the corresponding procedural resource
        /// </summary>
        protected void Update()
        {
            var procedural = ResourceProviderInternal.SelectProceduralResources()?.FirstOrDefault(item => item.Name == Name) ??
                             throw new InvalidOperationException($"Cannot update resource '{Name}'. Resource has not been inserted.");
            var resource = (IResourceInternal)Meta.Resource.SafeGet(procedural.Type) ??
                           throw new InvalidOperationException($"Cannot update resource '{Name}'. Resource has not been inserted.");

            resource.SetAlias(Alias);
            ResourceProviderInternal.SetProceduralResourceDescription(procedural, Description);
            resource.Description = Description;
            var methods = EnabledMethods.ResolveMethodRestrictions().ToArray();

            ResourceProviderInternal.SetProceduralResourceMethods(procedural, methods);
            resource.AvailableMethods = methods;
        }
        /// <summary>
        /// Deletes the corresponding procedural resource
        /// </summary>
        protected void Delete()
        {
            var procedural = ResourceProviderInternal.SelectProceduralResources()?.FirstOrDefault(item => item.Name == Name);

            if (procedural == null)
            {
                return;
            }
            var type = procedural.Type;

            Db.TransactAsync(() => ResourceAlias.GetByResource(procedural.Name)?.Delete());
            if (ResourceProviderInternal.DeleteProceduralResource(procedural))
            {
                ResourceProviderInternal.RemoveProceduralResource(type);
            }
        }
 /// <summary>
 /// Selects the instances that have been inserted by this controller
 /// </summary>
 protected static IEnumerable <TController> Select() => ResourceProviderInternal
 .SelectProceduralResources()
 .OrderBy(r => r.Name)
 .Select(r => Make <TController>(Meta.Resource.SafeGet(r.Name)));