hello
this is Ramda Code..
An error occurs in lambda expression.
Please Help me
this is Ramda Code..
An error occurs in lambda expression.
Please Help me
C#:
public class Service : IService
{
private readonly Func<string, string> SelectTarget;
private class RequestTypeParser
{
public readonly Func<string, RequestType> Parse;
public RequestTypeParser(Func<string, Func<string, bool>> regexCreator)
{
var IsOld = regexCreator(@"A\d{8}");
var IsNew = regexCreator(@"B\d{4}");
Parse = (Number) =>
{
RequestType type = RequestType.Invalid;
if (IsOld(Number))
type = RequestType.Old;
else if (IsNew(Number))
type = RequestType.New;
return type;
};
}
}
private enum RequestType
{
Old,
New
}
public Service()
{
RequestTypeParser parser = new RequestTypeParser
((pattern) =>
{
Regex regex = new Regex(pattern);
return (input) => regex.IsMatch(input);
});
SelectTarget = (string Number) => parser.Parse(Number); <==== Error Error Error ㅠㅠ
}
}
Last edited: