22 lines
466 B
C#
22 lines
466 B
C#
|
using System.Text;
|
||
|
|
||
|
namespace MyDarling.Controllers;
|
||
|
|
||
|
public interface IRobotsTxtGenerator
|
||
|
{
|
||
|
public string GetRobotsText();
|
||
|
}
|
||
|
|
||
|
public class RobotsTxtGenerator : IRobotsTxtGenerator
|
||
|
{
|
||
|
public string GetRobotsText()
|
||
|
{
|
||
|
StringBuilder stringBuilder = new();
|
||
|
stringBuilder.AppendLine("user-agent: *");
|
||
|
stringBuilder.AppendLine("disallow: /freedom");
|
||
|
stringBuilder.AppendLine("disallow: /Account/");
|
||
|
|
||
|
return stringBuilder.ToString();
|
||
|
}
|
||
|
}
|