小编alg*_*hiz的帖子

我在解码错误更新 NuGet 包时发现无效数据

我一直在尝试从包管理器控制台和从上下文选项管理 NuGet 包更新 Visual Studio 2019 中的 NuGet 包,但在这两种情况下,我都收到“在解码时发现无效数据”。错误。

我必须恢复到 Visual Studio 2017 才能更新。有没有办法解决这个问题,还是我现在必须应对这种转换?

两种情况的错误输出如下:

在此处输入图片说明

visual-studio-2019

22
推荐指数
1
解决办法
8740
查看次数

重构到域驱动设计

我有一个场景我试图重构DDD.我有一个Batch,它是一个聚合和BatchEntries列表.创建批处理并添加BatchEntries后,将向批处理中的个人发送SMS,并且批处理的状态将从运行更改为已发布.

关于如何使设计更好的任何想法?该域有两个聚合Batch和BatchEntry,Batch是聚合根.

代码看起来像这样

public class Batch : EntityBase, IValidatableObject
{
    public int BatchNumber { get; set; }
    public string Description { get; set; }
    public decimal TotalValue { get; set; }
    public bool SMSAlert { get; set; }
    public int Status { get; set; }

    private HashSet<BatchEntry> _batchEntries;
    public virtual ICollection<BatchEntry> BatchEntries
    {
        get{
            if (_batchEntries == null){
                _batchEntries = new HashSet<BatchEntry>();
            }
            return _batchEntries;
        }
        private set {
            _batchEntries = new HashSet<BatchEntry>(value);
        }
    }

    public static Batch Create(string description, …
Run Code Online (Sandbox Code Playgroud)

c# oop domain-driven-design onion-architecture

0
推荐指数
1
解决办法
680
查看次数