Controller with TemplateService I am working on my template web api project.

I just wanna hear any suggestion how to improve this code. I heard that repository pattern is anti pattern so I want to make code without it. Any opinion will be great :D

Service

public class TemplateService : ITemplateService
{
    private readonly ContextTemplate context;

    public TemplateService(ContextTemplate context)
    {
        this.context = context;
    }

    public int AddTemplate(TemplateInput input)
    {
        var template = new TemplateModel()
        {
            Name = input.Name,
            CreatedDate = DateTime.UtcNow
        };

        context.TemplateModel.Add(template);
        context.SaveChanges();
        return template.Id;
    }

    public int UpdateTemplate(TemplateInput input)
    {
        var template = GetTemplate(input.Id);
        if (template != null)  {
            template.Name = input.Name;
            template.ModifiedDate = DateTime.UtcNow;
            context.Update(template);
            context.SaveChanges();
        }
        return (int)template?.Id;
    }

    public bool ArchiveTemplate(int templateId)
    {
        var isArchiveSuccessfull = false;
        var template = GetTemplate(templateId);
        if (template != null)
        {
            template.IsArchived = true;
            isArchiveSuccessfull = true;
            context.Update(template);
            context.SaveChanges();
        }
        return isArchiveSuccessfull;
    }

    public IEnumerable&lt;TemplateModelDto&gt; GetTemplates()
    {
        return Mapper.Map&lt;List&lt;TemplateModel&gt;, List&lt;TemplateModelDto&gt;&gt;(this.context.TemplateModel.Where(x=&gt;!x.IsArchived).ToList());
    }

    public TemplateModel GetTemplate(int templateId)
    {
        var template = context.TemplateModel.FirstOrDefault(x =&gt; x.Id == templateId);
        return template;
    }


Controller

 [Route("api/[controller]")]
 public class TemplatesController : Controller
 {
    private readonly ITemplateService templateService;
    private readonly ILogger logger;

    public TemplatesController(ITemplateService templateService, ILogger&lt;TemplatesController&gt; logger)
    {
        this.templateService = templateService;
        this.logger = logger;
    }
    // GET api/templates
    [HttpGet]
    public IEnumerable&lt;TemplateModelDto&gt; Get() =&gt; templateService.GetTemplates();

    // GET api/templates/5
    [HttpGet("{templateId}")]
    public TemplateModel GetTemplate(int templateId) =&gt;  templateService.GetTemplate(templateId);

    // POST api/templates
    [HttpPost]
    public int Post([FromBody]TemplateInput input) =&gt; templateService.AddTemplate(input);

    // PUT api/templates/5
    [HttpPut("{templateId}")]
    public int Put(int templateId, [FromBody]TemplateInput input) =&gt; templateService.UpdateTemplate(input);

    // DELETE api/templates/5
    [HttpDelete("{templateId}")]
    public Boolean ArchiveTemplate(int templateId) =&gt; templateService.ArchiveTemplate(templateId);
}
You have abstracted away any concrete dependencies from the controller. I  say that is well done for decoupling the controller and would allow better testability of the controller. 

ContextTemplate is assumed to be DbContext derived, which already implements Unit of Work and Repository pattern so there is really no use in re-implementing the pattern.

IMO I see no immediate problems with the above code apart from the non use of the explicitly injected ILogger in the controller, which can be removed if there is no use for it in the controller. Logging can be considered a cross-cutting concern in asp.net-core and handled external to the controller.