Created
May 27, 2019 17:57
-
-
Save gashupl/fcf8396b520296a3f50cff19522f0d41 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 OpportunityRepository : IOpportunityRepository | |
| { | |
| protected IOrganizationService orgService; | |
| public OpportunityRepository(IOrganizationService service) | |
| { | |
| this.orgService = service; | |
| } | |
| public Opportunity GetById(Guid id) | |
| { | |
| return this.orgService.Retrieve(Opportunity.EntityLogicalName, id, new ColumnSet(true))?.ToEntity<Opportunity>(); | |
| } | |
| public Guid Create(Opportunity opportunity) | |
| { | |
| return this.orgService.Create(opportunity); | |
| } | |
| public void Dispose() | |
| { | |
| this.serviceContext.Dispose(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment