I have an interface:
void InsertPersonActivityLog(PersonActivityLog dateTime, PersonActivityLog typeDefinition, PersonActivityLog details, Person edi, Person firstName, Person middleInitial, Person lastName, PersonActivityLog message, PersonActivityLog notes);
The method for that interface is:
public void InsertPersonActivityLog(PersonActivityLog dateTime, PersonActivityLog typeDefinition, PersonActivityLog details, Person edi, Person firstName, Person middleInitial, Person lastName, PersonActivityLog message, PersonActivityLog notes) // how to EF executes SP's { /// TO DO insert or add these to my table syntax /// cmd.Parameters.AddWithValue("@LogId", log.LogId); /// cmd.Parameters.AddWithValue("@Edi", log.Edi); // and so on }
In my service I have a login method that calls:
public void Login(Person person) { PersonActivityLog log = new PersonActivityLog(); Person login = new Person(); log.ActivityDatetime = DateTime.UtcNow; log.ActivityTypeDefinition = "Registration Status"; log.AdditionalDetails = "Visitor"; login.Edi = person.Edi; login.FirstName = person.FirstName; login.MiddleInitial = person.MiddleInitial; login.LastName = person.LastName; log.ReasonMessage = "Emtpy"; log.Notes = "visited the site"; InsertPersonActivityLog(DateTime.Now, log.ActivityTypeDefinition, log.AdditionalDetails, login.Edi, login.FirstName, login.MiddleInitial, login.LastName, log.ReasonMessage, log.Notes); }
But how do I call my method from here (in the service)?
private void InsertPersonActivityLog(DateTime now, string activityTypeDefinition, string additionalDetails, string edi, string firstName, string middleInitial, string lastName, string reasonMessage, string notes) { _personActivityLogRepository.InsertPersonActivityLog( what goes here???) }