Exemplo n.º 1
0
        //
        // Details
        //

        static bool TryGetKey(Type declaredType, out DurableTypeKey key)
        {
            var value =
                declaredType.GetCustomAttribute <DurablePrefixAttribute>()?.Prefix
                ?? declaredType.Assembly.GetCustomAttribute <DurablePrefixAttribute>()?.Prefix
                ?? "";

            key = DurablePrefix.TryFrom(value, out var prefix)
        ? DurableTypeKey.From(prefix, TypeName.From(declaredType))
        : null;

            return(key != null);
        }
Exemplo n.º 2
0
 static DurableType CreateType(DurablePrefix prefix, Type declaredType) =>
 new DurableType(
     DurableTypeKey.From(prefix, TypeName.From(declaredType)),
     declaredType);