Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Make new MutationContext<T> injectable. #15

@VictorioBerra

Description

@VictorioBerra

Since the MutationContext<T> is not injectible into my code because of the ctor, I cant Moq it or test it.

IE:

.AddSingleton<MutationContext<Customer>>()

Later:

public class CustomerRepository
{
    public MutationContext<Customer> customerMutationContext { get; set; }

    public CustomerRepository(MutationContext<Customer> customerMutationContext)
    {
        this.customerMutationContext = customerMutationContext;
    }

    public void SaveCustomer(Customer cust)
    {
        this.customerMutationContext.Init(cust).Mutate();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions