//fits better in the lenguage
        public static Expense Produce(ProducerId producerId, DateTime occurred, Money cost, CategoryId categoryId)
        {
            Guard.ThrowIfItIsNull(producerId, nameof(producerId));
            Guard.ThrowIfItIsNull(occurred, nameof(occurred));
            Guard.ThrowIfItIsNull(cost, nameof(cost));
            Guard.ThrowIfItIsNull(categoryId, nameof(categoryId));

            return(new Expense(producerId, occurred, cost, categoryId));
        }
示例#2
0
 public Producer(ProducerId identifier)
 {
     Identifier = identifier;
 }