我可以使用什么来将数据从 D365 获取到我为此程序拥有的 JSON?

[ad_1]

我正在处理一个 API,并安装了一个包含 CrmEntity 和 D365Field 库的软件包。 我以前从未使用过 C# 中的 API。 我必须删除包中的所有内容并将当前代码转换为仍然运行相同的代码。 需要帮助了解从哪里开始或它应该是什么样子。 如果我删除 CrmEntity 和 D365Field,我可以使用什么来仍然将数据从 D365 获取到我为此程序拥有的 JSON?

C#
<pre>using OneDigital.WebApi.HttpClient.Lib.D365Entity;
using OneDigital.WebApiHttpClient.Models;

namespace BenchMarkingAPITab.Models
{
    public class Company : CrmEntity
    {
        public override string D365EntityName => "account";

        [D365Field(name: "accountid")]
        public override Guid CrmId { get; set; }

        [D365Field(name: "name")]
        public string? CompanyName { get; set; }

        [D365Field(name: "parentaccountid", isForeignKey: true, dataBindEntity: "account")]
        public Guid? ParentAccountId { get; set; }

        [D365Field(name: "parentaccountid", isForeignKey: true, dataBindEntity: "account", useFormattedValue: true)]
        public string? ParentAccountName { get; set; }

        [D365Field(name: "digins_companytype")]
        public int CompanyTypeId { get; set; }

        [D365Field(name: "digins_companytype", useFormattedValue: true)]
        public string? CompanyTypeName { get; set; }

        [D365Field(name: "digins_effectivedate")]
        public DateTime? EffectiveDate { get; set; }

        [D365Field(name: "NumberOfEmployees")]
        public int NumberOfEmployees { get; set; }

        [D365Field(name: "digins_stateid", useFormattedValue: true, dataBindEntity: "digins_stateid")]
        public Guid? StateName { get; set; }

        [D365Field(name: "digins_stateid", useFormattedValue: true)]
        public string? State { get; set; }

        [D365Field(name: "digins_industryid", isForeignKey: true, dataBindEntity: "digins_industry", fieldSchemaName: "digins_IndustryId")]
        public Guid? Industry { get; set; }

        [D365Field(name: "digins_sic", isForeignKey: true, dataBindEntity: "SIC/NAICS Code", useFormattedValue: true)]
        public int IndustryCode { get; set; }

        [D365Field(name: "adx_partner_status", useFormattedValue: true)]
        public string? Partner { get; set; }

        [D365Field(name: "OwnerId", useFormattedValue: true)]
        public string? OwnerId { get; set; }

        [D365Field(name: "AccountCategoryCode")]
        public string? Category { get; set; }
    }

    public class User : CrmEntity
    {
        public override string D365EntityName => "systemuser";

        [D365Field(name: "systemuserid")]
        public override Guid CrmId { get; set; }

        [D365Field(name: "DomainName")]
        public string? UserName { get; set; }

    }

    public class Product : CrmEntity
    {
        public override string D365EntityName => "digins_product";

        [D365Field(name: "digins_productid")]
        public override Guid CrmId { get; set; }

        [D365Field(name: "digins_ProductName")]
        public string? ProductName { get; set; }

        [D365Field(name: "digins_producttype")]
        public string? ProductType { get; set;}

        [D365Field(name: "digins_productplantype")]
        public string? ProductPlanType { get; set; }

    }

    public class PlanDetail : CrmEntity
    {
        public override string D365EntityName => "digins_plandetail";

        [D365Field(name: "digins_plandetalid")]
        public override Guid CrmId { get; set; }

        [D365Field(name: "digins_name")]
        public string? name { get; set; }

        [D365Field(name: "digins_innetwork")]
        public string? Innetwork { get; set; }

        [D365Field(name: "AccountCategoryCode")]
        public string? Category { get; set; }

    }

    public class PlanRate : CrmEntity
    {
        public override string D365EntityName => "digins_planrate";

        [D365Field(name: "digins_planrateid")]
        public override Guid CrmId { get; set; }

        [D365Field(name: "digins_tiertype")]
        public string? TierType { get; set; }

        [D365Field(name: "digins_ratetype")]
        public string? RateType { get; set; }

        [D365Field(name: "TransactionCurrencyId")]
        public int TransactionCurrencyId { get; set; }

        [D365Field(name: "digins_employeerate_money")]
        public int EmployeeRateMoney { get; set; }

        [D365Field(name: "digins_employerrate_money")]
        public int EmployerateMoney { get; set; }

        [D365Field(name: "digins_employeerate_percent")]
        public int EmployeeRatePercent { get; set; }

        [D365Field(name: "digins_employerrate_percent")]
        public int EmployerRatePercent { get; set; }

        [D365Field(name: "digins_contributionunit")]
        public int ContributionUnite { get; set; }

        [D365Field(name: "digins_monthlypremium")]
        public int MonthlyPremium { get; set; }


    }
}

我尝试过的:

我已尝试删除该软件包。

解决方案1

你的问题没有意义。

删除这些软件包后,无论如何您都必须重写代码以删除所有提及的 CrmEntity 和 D365。 这是无法回避的。

由于我不知道 CrmEntity 和 D365 会做什么,因此我无法评论删除所有代码后会发生什么以及它如何影响其功能或您的 API。 无论如何,您可能都必须重写该内容以替换丢失的功能。

[ad_2]

コメント

标题和URL已复制