EasyLateBound.PluginAssemblies 1.0.0

Library for converting the crm attributes in a class quickly and easily.
              Use the attribute 'DisplayName' of the Assembly: System.ComponentModel in yours entity class.

Install-Package EasyLateBound.PluginAssemblies -Version 1.0.0
dotnet add package EasyLateBound.PluginAssemblies --version 1.0.0
<PackageReference Include="EasyLateBound.PluginAssemblies" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyLateBound.PluginAssemblies --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

In your entity class you must add the library: "using System.ComponentModel" for use DisplayName
for the id attribute you can use the id name or its name in crm for this case "contactid"

    [DisplayName("id")]
    public Guid Id { get; set; }

    [DisplayName("contactid")]
    public Guid Id { get; set; }

When you retrieve an entity-type response, you can use the extension method to convert your entity into the class you need.
return result.Entities.Select(e => e.ConvertFromEntity<Contact>()).ToList();

special cases:

Custom class for entityreference type:

public class LookUp
{
[DisplayName("id")]
public Guid Id { get; set; }

     [DisplayName("name")]
     public string Name { get; set; }

    [DisplayName("logicalname")]
     public string LogicalName { get; set; }
}

EntityReference Casts:

    [DisplayName("ownerid")]
    public Guid ownerId { get; set; }

    [DisplayName("ownerid")]
    public string ownerIdName { get; set; }

    [DisplayName("ownerid")]
    public LookUp ownerId { get; set; }

Custom class for my optionsetvalue:

public class OptionSet
{
[DisplayName("name")]
public string Label { get; set; }

    [DisplayName("value")]
    public int Value { get; set; }
}

optionsetvalue cats:

  // enums support
    [DisplayName("statuscode")]
    public StatusCode StatusCode { get; set; }

    [DisplayName("statuscode")]
    public OptionSet StatusCodeObject { get; set; }

    [DisplayName("statuscode")]
    public string StatusCodeLabel { get; set; }

EntityCollection casts:

    [DisplayName("to")]
    public Guid To { get; set; }

    [DisplayName("to")]
    public EntityReference To2 { get; set; }

    [DisplayName("to")]
    public List<LookUp> To3 { get; set; }

    [DisplayName("to")]
    public LookUp To4 { get; set; }

Money casts:

    [DisplayName("creditlimit")]
    public Money CreditLimit { get; set; }

    [DisplayName("creditlimit")]
    public decimal CreditLimitDecimal { get; set; }

AliasedValue casts:

// simplifies concatenates the alias with the name of the field of crm
    [DisplayName("user.businessunitid")]
    public LookUp BusinessUnit { get; set; }

    [DisplayName("user.businessunitid")]
    public Guid BusinessUnitGuid { get; set; }

In your entity class you must add the library: "using System.ComponentModel" for use DisplayName
for the id attribute you can use the id name or its name in crm for this case "contactid"

    [DisplayName("id")]
    public Guid Id { get; set; }

    [DisplayName("contactid")]
    public Guid Id { get; set; }

When you retrieve an entity-type response, you can use the extension method to convert your entity into the class you need.
return result.Entities.Select(e => e.ConvertFromEntity<Contact>()).ToList();

special cases:

Custom class for entityreference type:

public class LookUp
{
[DisplayName("id")]
public Guid Id { get; set; }

     [DisplayName("name")]
     public string Name { get; set; }

    [DisplayName("logicalname")]
     public string LogicalName { get; set; }
}

EntityReference Casts:

    [DisplayName("ownerid")]
    public Guid ownerId { get; set; }

    [DisplayName("ownerid")]
    public string ownerIdName { get; set; }

    [DisplayName("ownerid")]
    public LookUp ownerId { get; set; }

Custom class for my optionsetvalue:

public class OptionSet
{
[DisplayName("name")]
public string Label { get; set; }

    [DisplayName("value")]
    public int Value { get; set; }
}

optionsetvalue cats:

  // enums support
    [DisplayName("statuscode")]
    public StatusCode StatusCode { get; set; }

    [DisplayName("statuscode")]
    public OptionSet StatusCodeObject { get; set; }

    [DisplayName("statuscode")]
    public string StatusCodeLabel { get; set; }

EntityCollection casts:

    [DisplayName("to")]
    public Guid To { get; set; }

    [DisplayName("to")]
    public EntityReference To2 { get; set; }

    [DisplayName("to")]
    public List<LookUp> To3 { get; set; }

    [DisplayName("to")]
    public LookUp To4 { get; set; }

Money casts:

    [DisplayName("creditlimit")]
    public Money CreditLimit { get; set; }

    [DisplayName("creditlimit")]
    public decimal CreditLimitDecimal { get; set; }

AliasedValue casts:

// simplifies concatenates the alias with the name of the field of crm
    [DisplayName("user.businessunitid")]
    public LookUp BusinessUnit { get; set; }

    [DisplayName("user.businessunitid")]
    public Guid BusinessUnitGuid { get; set; }

Release Notes

Use the attribute 'DisplayName' of the Assembly: System.ComponentModel in yours entity class.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 245 4/19/2018