예제 #1
0
        internal protected virtual bool OnIsCreable(Type type, bool isSearchEntity)
        {
            EntitySettings es = EntitySettings.TryGetC(type);

            if (es != null)
            {
                if (!es.OnIsCreable(isSearchEntity))
                {
                    return(false);
                }
            }
            else
            {
                if (type.IsEntity())//HACK
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }

            foreach (var isCreable in IsCreable.GetInvocationListTyped())
            {
                if (!isCreable(type))
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #2
0
        internal protected virtual bool OnIsCreable(Type type, bool?isSearch)
        {
            EntitySettings es = EntitySettings.TryGetC(type);

            if (es == null)
            {
                return(true);
            }

            if (isSearch.HasValue && !es.OnIsCreable(isSearch.Value))
            {
                return(false);
            }


            if (IsCreable != null)
            {
                foreach (var isCreable in IsCreable.GetInvocationListTyped())
                {
                    if (!isCreable(type))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }