Created
July 4, 2019 06:15
-
-
Save gashupl/362da084f54ecc53f503b42718ba1fec 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>, new() | |
{ | |
var repository = new T(); | |
repository.Initialize(this.service); | |
return repository; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment