コード例 #1
0
        protected static string CodeSnippet(PersistedDataStructureInfo info)
        {
            return string.Format(
@"        public IEnumerable<{0}> Recompute(object filterLoad = null, Func<IEnumerable<{0}>, IEnumerable<{0}>> filterSave = null)
        {{
            return {2}(filterLoad, filterSave);
        }}

",
            info.GetKeyProperties(),
            info.Source.GetKeyProperties(),
            EntityComputedFromCodeGenerator.RecomputeFunctionName(new EntityComputedFromInfo { Source = info.Source, Target = info }));
        }
コード例 #2
0
        protected static string CodeSnippet(PersistedDataStructureInfo info)
        {
            return string.Format(
            @"        public void Recompute()
            {{
            Recompute<FilterAll>(null);
            }}

            public void Recompute<T>(T filterLoad)
            {{
            Recompute(filterLoad, x => x);
            }}

            public void Recompute<T>(T filterLoad, Func<IEnumerable<{0}>, IEnumerable<{0}>> filterSave)
            {{
            {2}<T>(filterLoad, filterSave);
            }}

            ",
            info.GetKeyProperties(),
            info.Source.GetKeyProperties(),
            EntityComputedFromInfo.RecomputeFunctionName(new EntityComputedFromInfo { Source = info.Source, Target = info }));
        }