예제 #1
0
        public static IEnumerable <Method> ForCollectionInterface(OdcmClass odcmClass, OdcmProjection projection)
        {
            var odcmMediaClass = odcmClass as OdcmMediaClass;

            if (odcmMediaClass != null)
            {
                return(ForMediaCollectionInterface(odcmMediaClass));
            }

            var retVal = new List <Method>();

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


            retVal.Add(new CollectionGetByIdMethod(odcmClass, projection));
            retVal.Add(new CollectionExecuteAsyncMethod(odcmClass));

            if (projection.SupportsUpdateLink())
            {
                retVal.Add(new CollectionAddLinkAsyncMethod(odcmClass));
            }
            if (projection.SupportsDeleteLink())
            {
                retVal.Add(new CollectionRemoveLinkAsyncMethod(odcmClass));
            }
            if (projection.SupportsInsert())
            {
                retVal.Add(new CollectionAddAsyncMethod(odcmClass));
            }
            if (projection.SupportsUpdate())
            {
                retVal.Add(new CollectionUpdateAsyncMethod(odcmClass));
            }
            if (projection.SupportsDelete())
            {
                retVal.Add(new CollectionDeleteAsyncMethod(odcmClass));
            }

            return(retVal);
        }