Exemple #1
0
        public static IEnumerable <Method> ForFetcherClass(OdcmClass odcmClass)
        {
            var retVal = new List <Method>();

            retVal.AddRange(Methods.ForEntityType(odcmClass));

            if (!odcmClass.IsAbstract)
            {
                retVal.Add(new FetcherExecuteAsyncMethod(odcmClass));

                foreach (var projection in odcmClass.DistinctProjections())
                {
                    if (projection.SupportsExpand())
                    {
                        retVal.Add(FetcherExpandMethod.ForFetcherClass(odcmClass, projection));
                    }
                }

                retVal.Add(FetcherUpdateMethod.ForFetcher(odcmClass));
                retVal.Add(FetcherSetMethod.ForFetcher(odcmClass));
                retVal.Add(FetcherUpdateLinkMethod.ForFetcher(odcmClass));
                retVal.Add(FetcherDeleteMethod.ForFetcher(odcmClass));
                retVal.Add(FetcherDeleteLinkMethod.ForFetcher(odcmClass));
                retVal.Add(FetcherSaveChangesAsyncMethod.ForFetcher(odcmClass));
            }

            if (!odcmClass.IsAbstract)
            {
                retVal.Add(new EnsureQueryMethod(odcmClass));
            }

            return(retVal);
        }