コード例 #1
0
        public static IEnumerable <Method> ForCollectionClass(OdcmClass odcmClass)
        {
            var odcmMediaClass = odcmClass as OdcmMediaClass;

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

            var retVal = new List <Method>();

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

            foreach (var projection in odcmClass.DistinctProjections())
            {
                retVal.Add(CollectionGetByIdMethod.ForCollectionClass(odcmClass, projection));
            }

            retVal.Add(new CollectionExecuteAsyncMethod(odcmClass));
            retVal.Add(new CollectionAddLinkAsyncMethod(odcmClass));
            retVal.Add(new CollectionRemoveLinkAsyncMethod(odcmClass));
            retVal.Add(new CollectionAddAsyncMethod(odcmClass));
            retVal.Add(new CollectionUpdateAsyncMethod(odcmClass));
            retVal.Add(new CollectionDeleteAsyncMethod(odcmClass));

            return(retVal);
        }
コード例 #2
0
ファイル: SourceCodeGenerator.cs プロジェクト: vikyding/Vipr
 private void Write(CollectionGetByIdMethod method)
 {
     WriteSignature(method);
     using (_builder.IndentBraced)
     {
         _("return GetFetcherById<{0}, {1}>((i) => {2});", NamesService.GetConcreteTypeName(method.OdcmClass),
           NamesService.GetFetcherTypeName(method.OdcmClass),
           method.ParameterToPropertyMap.ToEquivalenceString("i"));
     }
 }