I'm curious what's considered the (best) correct way to pass data to a service layer in ASP.net Core. Say I have a Person
entity that has a relation to a Image
(profile picture) entity and another relation to a Address
entity.
Should the signature of the service method look like this:
public Person CreateCustomer(Person person, Address address, Image profilePicture)
Or would it make more sense to put all the needed data in an interface:
public Person CreateCustomer(ICustomerDetails details)
Using the last approach, I would be able to make my ViewModel inherent from ICustomerDetails
and I could pass the ViewModel from the controller directly to the service layer.
What approach would be most advisable in this situation.