JamesRandall / FunctionMonkey

Write more elegant Azure Functions with less boilerplate, more consistency, and support for REST APIs. Docs can be found at https://functionmonkey.azurefromthetrenches.com
MIT License
294 stars 50 forks source link

FunctionMonkey.Compiler compilation error #81

Open KarachentsevDanil opened 5 years ago

KarachentsevDanil commented 5 years ago

Hi, James, for FM version 3.0.11-beta5 when you use arrays in commands you get the compilation error. public class GetItemsByIdsQuery : ICommand { public List Ids { get; set; } = new List(); }

Unhandled Exception: FunctionMonkey.ConfigurationException: CS0117:'string' does not contain a definition for 'TryParse' SourceFile(GetServicesByIds.cs[4720..4728)) at FunctionMonkey.Compiler.Implementation.AssemblyCompiler.CompileAssembly(IReadOnlyCollection1 syntaxTrees, IReadOnlyCollection1 externalAssemblyLocations, OpenApiOutputModel openApiOutputModel, String outputBinaryFolder, String outputAssemblyName, String assemblyNamespace, TargetEnum target) at FunctionMonkey.Compiler.Implementation.FunctionCompiler.Compile() in /Users/jamesrandall/code/myOpenSource/functionMonkey/Source/FunctionMonkey.Compiler/Implementation/FunctionCompiler.cs:line 86 at FunctionMonkey.Compiler.Program.Main(String[] args) in /Users/jamesrandall/code/myOpenSource/functionMonkey/Source/FunctionMonkey.Compiler/Program.cs:line 47

JamesRandall commented 5 years ago

The current release only works on typed arrays e.g. int[] and generic collections e.g. List or IReadOnlyCollection.

I'll look at adding support for the above in a point release.

KarachentsevDanil commented 5 years ago

The current release only works on typed arrays e.g. int[] and generic collections e.g. List or IReadOnlyCollection.

I'll look at adding support for the above in a point release. I thinks it's a problem exactly with string type. public List'<string'> Ids { get; set; } = new List'<string'>();

JamesRandall commented 5 years ago

Oh, that's interesting. Let me take a look!