protected CollectionBulkOrderDeed(Profession profession, BulkOrderDeedDefinition bulkOrderDeedDefinition, int quantity, bool exceptional, BulkOrderDeedMaterial material, Vendor vendor, BulkOrderDeedBook bulkOrderDeedBook) { Guard.ArgumentNotNull(nameof(profession), profession); Guard.ArgumentNotNull(nameof(bulkOrderDeedDefinition), bulkOrderDeedDefinition); Guard.ArgumentAtLeast(nameof(quantity), 1, quantity); // Note that material CAN be null (for instance, for inscription bulk order deeds). Id = Guid.NewGuid(); Profession = profession.Name; BulkOrderDeedDefinition = bulkOrderDeedDefinition; Quantity = quantity; Material = material != null ? material.Name : String.Empty; Exceptional = exceptional; Location = new BulkOrderDeedLocation(vendor, bulkOrderDeedBook); }
protected CollectionBulkOrderDeed(Guid id, string profession, string bulkOrderDeedNameMatch, BulkOrderDeedType bulkOrderDeedType, int quantity, bool exceptional, string material, Guid vendor, Guid bulkOrderDeedBook) { Guard.ArgumentNotEmpty(nameof(id), id); Guard.ArgumentNotNullOrEmpty(nameof(profession), profession); Guard.ArgumentNotNullOrEmpty(nameof(bulkOrderDeedNameMatch), bulkOrderDeedNameMatch); Guard.ArgumentNotOfValue(nameof(quantity), quantity, BulkOrderDeedManager.PossibleQuantities); // Note that material CAN be null (for instance, for inscription bulk order deeds). Id = id; Profession = profession; BulkOrderDeedDefinition = BulkOrderDeedManager.Instance.GetBulkOrderDeedDefinition(profession, bulkOrderDeedNameMatch, bulkOrderDeedType); Quantity = quantity; Material = material ?? String.Empty; Exceptional = exceptional; Location = new BulkOrderDeedLocation(Vendor.None, BulkOrderDeedBook.None); }