Skip to content

Instantly share code, notes, and snippets.

@enisn
Created January 15, 2022 13:09
Show Gist options
  • Save enisn/ff161c8e93e2ce044590da9118333145 to your computer and use it in GitHub Desktop.
Save enisn/ff161c8e93e2ce044590da9118333145 to your computer and use it in GitHub Desktop.
Mastering at Source Generators - Extending TodoController via inheriting
using Awesome.Api.Data;
namespace Awesome.Api.Controllers;
public abstract partial class TodoController
{
}
public class CustomTodoController : TodoController
{
public CustomTodoController(IRepository<Todo> repository) : base(repository)
{
}
public override Task UpdateAsync(Guid id, Todo item)
{
if (id == Guid.Empty)
{
throw new ArgumentException("id can't be empty.",nameof(id));
}
return base.UpdateAsync(id, item);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment