Repository, Service and Unit of Work

Should my controllers or services commit changes to database?
I currently have:

Core:

  • Invoice
  • Ticket

Application

Repositories:

  • IInvoiceRepository
  • ITicketRepository

Services:

  • IInvoiceService (gets invoices including their ticket)

Infrastructure

  • UnitOfWork (using DbContext and repositories as properties)
  • Repository implementation
  • Service implementation

Option 1:

InvoiceController.Delete:
var item = InvoiceService.GetAll()
InvoiceService.DeleteFull(item);
UoW.Commit();

Option 2:

InvoiceController.Delete:
var item = InvoiceService.GetAll()
InvoiceService.DeleteFull(item); // inside calls UoW.Commit();

I am having the same issue.
@Mosh I think that this is not properly explained in the [https://members.codewithmosh.com/courses/enrolled/236371](Entity Framework 6 in Depth) course.

I mean normaly you have the data acces layer defined via Repos. But you also got your servicees(buisness logic) which i think uses the Unit of Work.

But the service could now save at any given time but should it be alowed to do so?
Our should saving only occure in Controllers?