public static IEnumerable <Method> ForFetcherInterface(OdcmClass odcmClass) { var retVal = new List <Method>(); retVal.AddRange(Methods.ForEntityType(odcmClass)); if (!odcmClass.IsAbstract) { retVal.Add(new FetcherExecuteAsyncMethod(odcmClass)); retVal.Add(FetcherExpandMethod.ForFetcher(odcmClass)); } return(retVal); }
public static IEnumerable <Method> ForConcrete(OdcmClass odcmClass) { var retVal = Methods.ForConcreteInterface(odcmClass).ToList(); retVal.Add(new EnsureQueryMethod(odcmClass)); if (!odcmClass.IsAbstract) { retVal.Add(new ConcreteExecuteAsyncMethod(odcmClass)); retVal.Add(FetcherExpandMethod.ForConcrete(odcmClass)); } return(retVal); }
private void Write(FetcherExpandMethod method) { WriteSignature(method); using (_builder.IndentBraced) { if (method.DefiningInterface == null) { _("return ({0}) new {1}()", NamesService.GetFetcherInterfaceName(method.OdcmClass), NamesService.GetFetcherTypeName(method.OdcmClass)); using (_builder.IndentBraced) { _("_query = this.EnsureQuery().Expand<TTarget>(navigationPropertyAccessor)"); } _(";"); } else { _("return ({0}) this;", NamesService.GetFetcherInterfaceName(method.OdcmClass)); } } }