-
-
Save justinyoo/c9adc17279089057fea0 to your computer and use it in GitHub Desktop.
CRM 2015 Filtering Sample
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
[RoutePrefix("accounts")] | |
public class OrganisationController : ApiController | |
{ | |
private readonly IOrganisationServiceContext _context; | |
public OrganisationController(IOrganisationServiceContext context) | |
{ | |
this._context = context; | |
} | |
[Route("")] | |
public AccountModelCollection GetAccounts() | |
{ | |
var accounts = this._context | |
.AccountSet | |
.Select(p => new AccountModel() | |
{ | |
AccountNumber = p.AccountNumber, | |
Email = p.EMailAddress1 | |
}) | |
.ToList(); | |
var collection = new AccountModelCollection(accounts); | |
return collection; | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment