mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-08-01 02:35:58 +08:00
some tidying up and a bit of refactoring...not too happy about how the proxy is working at the moment! May need a rethink!
This commit is contained in:
@ -1,11 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using Ocelot.Library.Infrastructure.Responses;
|
||||
|
||||
namespace Ocelot.Library.Infrastructure.Configuration
|
||||
{
|
||||
public class ConfigurationValidationResult
|
||||
{
|
||||
public ConfigurationValidationResult(bool isError)
|
||||
{
|
||||
IsError = isError;
|
||||
Errors = new List<Error>();
|
||||
}
|
||||
|
||||
public ConfigurationValidationResult(bool isError, List<Error> errors)
|
||||
{
|
||||
IsError = isError;
|
||||
Errors = errors;
|
||||
}
|
||||
|
||||
public bool IsError { get; private set; }
|
||||
|
||||
public List<Error> Errors { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Ocelot.Library.Infrastructure.Responses;
|
||||
|
||||
namespace Ocelot.Library.Infrastructure.Configuration
|
||||
@ -19,7 +17,7 @@ namespace Ocelot.Library.Infrastructure.Configuration
|
||||
|
||||
if (duplicateUpstreamTemplates.Count <= 0)
|
||||
{
|
||||
return new OkResponse<ConfigurationValidationResult>(new ConfigurationValidationResult());
|
||||
return new OkResponse<ConfigurationValidationResult>(new ConfigurationValidationResult(false));
|
||||
}
|
||||
|
||||
var errors = new List<Error>();
|
||||
@ -31,7 +29,7 @@ namespace Ocelot.Library.Infrastructure.Configuration
|
||||
errors.Add(error);
|
||||
}
|
||||
|
||||
return new ErrorResponse<ConfigurationValidationResult>(errors);
|
||||
return new OkResponse<ConfigurationValidationResult>(new ConfigurationValidationResult(true, errors));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user