Created
July 4, 2019 06:16
-
-
Save gashupl/caf0a5da788f1c1c810bf4b000f16cc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RepositoryFactory | |
{ | |
private IOrganizationService service; | |
public RepositoryFactory(IOrganizationService service) | |
{ | |
this.service = service; | |
} | |
public T Get<E, T>() where E : Entity where T : RepositoryBase<E> | |
{ | |
var repository = (T)Activator.CreateInstance(typeof(T), this.service); | |
return repository; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment