public IBuildIntention <IImplementationDefinition> GetBuildIntention(IConversionContext context) { var(toBuild, maker) = ImplementationDefinition.Create(); return(new BuildIntention <IImplementationDefinition>(toBuild, () => { maker.Build( TransformerExtensions.Convert <IVerifiableType>(OutputType.GetOrThrow(), context), ContextDefinition.IfIs(x => x.GetValue()).GetOrThrow().Convert(context), ParameterDefinition.IfIs(x => x.GetValue()).GetOrThrow().Convert(context), Scope.Convert(context), MethodBody.Select(x => x.GetOrThrow().ConvertElementOrThrow(context)).ToArray(), StaticInitialzers.Select(x => x.ConvertElementOrThrow(context)).ToArray()); })); }
public override IBuildIntention <IInternalMethodDefinition> GetBuildIntention(IConversionContext context) { var(toBuild, maker) = MethodDefinition.Create(); return(new BuildIntention <IInternalMethodDefinition>(toBuild, () => { maker.Build( InputType.GetOrThrow().TypeDefinition.GetOrThrow().GetValue().GetOrThrow().ConvertTypeOrThrow(context), OutputType.GetOrThrow().TypeDefinition.GetOrThrow().GetValue().GetOrThrow().ConvertTypeOrThrow(context), ParameterDefinition.GetOrThrow().GetValue().GetOrThrow().Convert(context), Scope.Convert(context), Body.Select(x => x.GetOrThrow().ConvertElementOrThrow(context)).ToArray(), StaticInitailizers.Select(x => x.GetOrThrow().ConvertElementOrThrow(context)).ToArray(), IsEntryPoint); })); }