public EventDescription(DateTime eventDate, string description, ISystemDate systemDate) { if (eventDate < systemDate.Today) { throw new Exception("concert date must be future date"); } EventDate = eventDate; Description = description; _systemDate = systemDate; }
public Container(CampaignTypeEnum type, IBridgeServicesProvider bridge, CampaignWorkerFactory campaignWorkerFactory, ISystemDate systemDate, ILogger <Container> logger) : base(type) { _campaignWorkerFactory = campaignWorkerFactory; _logger = logger; _bridge = bridge; _systemDate = systemDate; _campaignsWorkers = new CampaignWorkerList <ICampaignWorker>(_campaignWorkerFactory); }
/// <summary> Супер сервис с логированием </summary> public CoolServiceWithLog(ICoolService coolService, ILogger logger, ISystemDate systemDate) { _coolService = coolService; _logger = logger; _systemDate = systemDate; }
private Concert CreateInternal(string titleGeo, string titleEng, string description, DateTime concertDate, ConcertId id = null, ISystemDate systemDate = null) { return(new Concert( id ?? new ConcertId(Guid.NewGuid().ToString()), new EventTitleSummary(new GeoTitle(titleGeo)).WithAnotherTitle(new EngTitle(titleEng)), new EventDescription(concertDate, description, systemDate ?? SystemDate.Now()) )); }
public Concert Create(ConcertId id, string titleGeo, string titleEng, string description, DateTime concertDate, ISystemDate systemDate = null) { return(CreateInternal(titleGeo, titleEng, description, concertDate, id, systemDate)); }
/// <summary> Супер сервис </summary> public CoolService(ILogger logger, ISystemDate systemDate) { _logger = logger; _systemDate = systemDate; }