예제 #1
0
        void CreateNewFunctions <TPocoElement, TScheme, TSchemeElement>(Expression <Func <TPoco, IReadOnlyList <TPocoElement> > > getter)
            where TPocoElement : PocoClass, new()
            where TScheme : RealmObject
            where TSchemeElement : RealmObject
        {
            var funcs = new ListPropertyFunctions <TPoco, TPocoElement, TScheme, TSchemeElement>();

            funcs.CreateGetterSetter(getter);
            listHandlers.Add(typeof(TPocoElement), funcs);
            Accessers.AddFunctionGroup <TPoco, TPocoElement>(funcs);
        }
예제 #2
0
        protected private IReadOnlyList <TPocoElement> AddListProperty <TPocoElement, TScheme, TSchemeElement>(Expression <Func <TPoco, IReadOnlyList <TPocoElement> > > getter)
            where TPocoElement : PocoClass, new()
            where TScheme : RealmObject
            where TSchemeElement : RealmObject
        {
            if (!Accessers.GetFunctionGroup <TPoco, TPocoElement>(out var cache))
            {
                CreateNewFunctions <TPocoElement, TScheme, TSchemeElement>(getter);
            }
            else
            {
                if (!Accessers.HasCache <TPoco, TPocoElement>())
                {
                    CreateNewFunctions <TPocoElement, TScheme, TSchemeElement>(getter);
                }
            }

            return(new List <TPocoElement>());
        }