0
0

Move RobotsTxtGenerator class to separate file

This commit is contained in:
Sergey Chebotar 2023-06-14 08:03:29 +03:00
parent fc5c75131c
commit 57f7cb28a5
2 changed files with 17 additions and 14 deletions

17
RobotsTxtGenerator.cs Normal file
View File

@ -0,0 +1,17 @@
using System.Text;
namespace MyDarling.Controllers;
public class RobotsTxtGenerator : IRobotsTxtGenerator
{
public string GetRobotsText()
{
StringBuilder stringBuilder = new();
stringBuilder.AppendLine("user-agent: *");
stringBuilder.AppendLine("Disallow: /freedom");
stringBuilder.AppendLine("Disallow: /Account/");
stringBuilder.AppendLine("Disallow: /account/");
return stringBuilder.ToString();
}
}

View File

@ -6,17 +6,3 @@ public interface IRobotsTxtGenerator
{ {
public string GetRobotsText(); 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/");
stringBuilder.AppendLine("Disallow: /account/");
return stringBuilder.ToString();
}
}