public RuntimeTypeRef(RuntimePackage package, Type declaredType) { Package = package; DeclaredType = declaredType; State = new RuntimeState(declaredType); Key = RuntimeTypeKey.From(package.RegionKey, declaredType.Name); }
public override T Get(RuntimeTypeKey key, bool strict = true) { T type; ExpectNot(_typesByKey.TryGetValue(key, out type) && strict, "Unknown domain key: " + Text.Of(key)); return(type); }
private T GetPackageType <T>(RuntimeTypeKey key, Func <RuntimePackage, RuntimeTypeSetBase <T> > selectTypes, bool strict = true) where T : RuntimeType { var packageType = this .Select(package => selectTypes(package).Get(key, strict: false)) .FirstOrDefault(type => type != null); ExpectNot(strict && packageType == null, $"Failed to resolve {typeof(T)} by key: {key}"); return(packageType); }
public AreaType GetArea(RuntimeTypeKey key, bool strict = true) { return(GetPackageType(key, package => package.Areas, strict)); }
public EventType GetEvent(RuntimeTypeKey key, bool strict = true) { return(GetPackageType(key, package => package.Events, strict)); }
public AreaType GetArea(RuntimeTypeKey key, bool strict = true) { var region = Get(key.Region, strict); return(region?.GetArea(key, strict)); }
public FlowType GetFlow(RuntimeTypeKey key, bool strict = true) { return(Regions.GetFlow(key, strict)); }
public RequestType GetRequest(RuntimeTypeKey key, bool strict = true) { return(GetPackageType(key, package => package.Requests, strict)); }
public WebApiType GetWebApi(RuntimeTypeKey key, bool strict = true) { var region = Get(key.Region, strict); return(region?.GetWebApi(key, strict)); }
public TopicType GetTopic(RuntimeTypeKey key, bool strict = true) { return(Packages.GetTopic(key, strict)); }
public QueryType GetQuery(RuntimeTypeKey key, bool strict = true) { return(GetPackageType(key, package => package.Queries, strict)); }
public AreaType GetArea(RuntimeTypeKey key, bool strict = true) { return(Packages.GetArea(key, strict)); }
public EventType GetEvent(RuntimeTypeKey key, bool strict = true) { return(Packages.GetEvent(key, strict)); }
public DurableType GetDurable(RuntimeTypeKey key, bool strict = true) { return(Packages.GetDurable(key, strict)); }
public WebApiType GetWebApi(RuntimeTypeKey key, bool strict = true) { return(Packages.GetWebApi(key, strict)); }
public RequestType GetRequest(RuntimeTypeKey key, bool strict = true) { return(Packages.GetRequest(key, strict)); }
public FlowType GetFlow(RuntimeTypeKey key, bool strict = true) { return(GetPackageType(key, package => package.Flows, strict)); }
public QueryType GetQuery(RuntimeTypeKey key, bool strict = true) { return(Packages.GetQuery(key, strict)); }
public TopicType GetTopic(RuntimeTypeKey key, bool strict = true) { return(GetPackageType(key, package => package.Topics, strict)); }
public ViewType GetView(RuntimeTypeKey key, bool strict = true) { return(Packages.GetView(key, strict)); }
public ViewType GetView(RuntimeTypeKey key, bool strict = true) { return(GetPackageType(key, package => package.Views, strict)); }
public WebApiType GetWebApi(RuntimeTypeKey key, bool strict = true) { return(GetPackageType(key, package => package.WebApis, strict)); }
public QueryType GetQuery(RuntimeTypeKey key, bool strict = true) { var region = Get(key.Region, strict); return(region?.GetQuery(key, strict)); }
public FlowType GetFlow(RuntimeTypeKey key, bool strict = true) { var region = Get(key.Region, strict); return(region?.GetFlow(key, strict)); }
public DurableType GetDurable(RuntimeTypeKey key, bool strict = true) { var region = Get(key.Region, strict); return(region?.GetDurable(key, strict)); }
public override T this[RuntimeTypeKey key] => _typesByKey[key];
public EventType GetEvent(RuntimeTypeKey key, bool strict = true) { var region = Get(key.Region, strict); return(region?.GetEvent(key, strict)); }
public override bool Contains(RuntimeTypeKey key) { return(_typesByKey.ContainsKey(key)); }
public TopicType GetTopic(RuntimeTypeKey key, bool strict = true) { var region = Get(key.Region, strict); return(region?.GetTopic(key, strict)); }
public DurableType GetDurable(RuntimeTypeKey key, bool strict = true) { return(GetPackageType(key, package => package.Durable, strict)); }