Files
octokit.net/Octokit.Tests.Conventions/Exception/ResponseModelSetterlessAutoPropertyException.cs
2022-07-11 09:12:20 -05:00

22 lines
814 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Octokit.Tests.Conventions
{
public class ResponseModelSetterlessAutoPropertyException : Exception
{
public ResponseModelSetterlessAutoPropertyException(Type modelType, IEnumerable<PropertyInfo> setterlessProperties)
: base(CreateMessage(modelType, setterlessProperties))
{ }
static string CreateMessage(Type modelType, IEnumerable<PropertyInfo> setterlessProperties)
{
return string.Format("Model type '{0}' contains the following setterless properties: {1}{2}",
modelType.FullName,
Environment.NewLine,
string.Join(Environment.NewLine, setterlessProperties.Select(x => x.Name)));
}
}
}