# Clean architecture. How to use Multiple contexts in single handler? [closed]

Clean architectures involves handler which takes commands as input and responses as outputs For example: We have a model

public class Lecture
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int Id { get; set; }
public string Name { get; set; }
public List<Student> Students { get; set; }
}


and a Sync Controller Action which takes all students and lectures to save them in database in one call.

My question is how many handlers we should make in this scenerio? Only SyncLecture Handler or SyncStudent Handler as well ?

Another problem is that how can we include multiple repositories in single handler? Is it semantic approach?

Finally, if we use multiple repositories or even multiple handler in the same controller action, How can we make it atomic. So that students are saved but we we got some error on lectures so student must not be saved either. We do this using transaction in DB context. but in this scenerio. I don't know how to deal with it.