首页 > 解决方案 > 如何使用带有 grpc 重复类型的 automapper

问题描述

我有以下谷歌原型模型

message PlatformsDTO
{
    repeated .cms.PlatformDTO Platforms = 1;
}
message PlatformDTO{
    string Code = 1;
    string Name = 2;
    bool IsActive =3;
}

以及我的平台模型的以下类实现

public class PLATFORMS
{
    public string Code { get; set; }

    public string Name { get; set; }

    public bool IsActive { get; set; }
}

我想要实现的是将 PlatformsDto 的重复 Platforms 属性映射到List<PLATFORMS>

我将不胜感激任何帮助,因为我不知道如何做到这一点..

标签: c#automappergrpcproto

解决方案


推荐阅读