コード例 #1
0
        private object GetObjectByHref(string href, IFrameworkFacade facade, UriMtHelper helper, IOidStrategy oidStrategy)
        {
            string[] oids = helper.GetObjectId(href);
            if (oids != null)
            {
                var oid = facade.OidTranslator.GetOidTranslation(oids[0] + "/" + oids[1]);
                return(facade.GetObject(oid).Target?.Object);
            }
            string typeName = helper.GetTypeId(href);

            return(facade.GetDomainType(typeName));
        }
コード例 #2
0
        private object GetObjectByHref(string href, INakedObjectsSurface surface, UriMtHelper helper)
        {
            string[] oids = helper.GetObjectId(href);
            if (oids != null)
            {
                var oid = new LinkObjectId(oids[0], oids[1]);
                return(surface.GetObject(oid).Target.Object);
            }
            string typeName = helper.GetTypeId(href);

            return(surface.GetDomainType(typeName));
        }
コード例 #3
0
        private static object GetObjectByHref(string href, IFrameworkFacade facade, UriMtHelper helper, IOidStrategy oidStrategy)
        {
            var oids = UriMtHelper.GetObjectId(href);

            if (oids != null)
            {
                var oid = facade.OidTranslator.GetOidTranslation($"{oids.Value.type}/{oids.Value.key}");
                return(facade.GetObject(oid).Target?.Object);
            }

            var typeName = UriMtHelper.GetTypeId(href);

            return(facade.GetDomainType(typeName));
        }