Giter Club home page Giter Club logo

crmnx.xrm.toolkit's Introduction

.NET Core Version Downloads

CrmNx.Xrm.Toolkit

Dynamics 365 WebApi Toolkit library for .Net.

Currently, support only on-premise with AD authentication.

Getting started

Add connection string with a name "Crm".

// appsettings.json

"ConnectionStrings": {
    "Crm": "Url=https://host.local;Username=;Password=;Domain=DMNAME;Authtype=AD"
  }

ConfigureServices.

// Startup.cs 

public void ConfigureServices(IServiceCollection services) 
{
    ...
    services.AddCrmWebApiClient();
    ...
}

Inject ICrmWebApiClient into ApiController or another class

// AccountController.cs 
...
using System.Threading.Tasks;
using CrmNx.Xrm.Toolkit;
using CrmNx.Xrm.Toolkit.Query;
...

[ApiController]
public class AccountController : ControllerBase
{
    private readonly ICrmWebApiClient _crmClient;

    public AccountController(ICrmWebApiClient crmClient)
    {
        _crmClient = crmClient ?? throw new ArgumentNullException(nameof(crmClient));
    }
    
    [HttpGet]
    public async Task<IActionResult> GetAccounts(CancellationToken cancellationToken)
    {
        // await _crmClient.RetrieveMultipleAsync("account") - Retrieved all fields
        var collection = await _crmClient.RetrieveMultipleAsync("account", QueryOptions.Select("fullname"), cancellationToken);
        
        return Ok(collection.Entities);
    }
}

crmnx.xrm.toolkit's People

Contributors

ttkoma avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.