Ejemplo n.º 1
0
        public static void TaskSetImplementations(LineBase bl)
        {
            EntityBase eb = bl as EntityBase;

            if (eb != null)
            {
                PropertyRoute route = bl.PropertyRoute;

                if (bl.Type.IsMList())
                {
                    route = route.Add("Item");
                }

                if (route.Type.CleanType().IsIEntity())
                {
                    IImplementationsFinder finder = typeof(ModelEntity).IsAssignableFrom(route.RootType) ?
                                                    (IImplementationsFinder)Navigator.EntitySettings(route.RootType) : Schema.Current;

                    eb.Implementations = finder.FindImplementations(route);

                    if (eb.Implementations.Value.IsByAll)
                    {
                        EntityLine el = eb as EntityLine;
                        if (el != null)
                        {
                            el.Autocomplete = false;
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public IEnumerable <IService> GenerateServices(Type type, IAssemblyList assemblies, object instance = null, IConstructorParameters constructorParameters = null)
        {
            if (TypeIsClassValidator.Validate(type))
            {
                IService service = ServiceGenerator.GenerateService(type, instance, constructorParameters);
                yield return(service);
            }

            else
            {
                IEnumerable <Type> types = ImplementationsFinder.FindImplementations(assemblies, type);

                foreach (Type @class in types)
                {
                    IService service = ServiceGenerator.GenerateService(@class, null, constructorParameters);
                    yield return(service);
                }
            }
        }