Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CRM 2015 Filtering Sample
[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
You can’t perform that action at this time.