public Task Handle(JobAssignCreatedFromGlobalEvent message) { return(UpdateJobAssign(Guid.Parse(message.SourceId), Builders <JobAssign> .Update.Set(f => f.HousingDepartmentIdList, message.HousingDepartmentIdList), Builders <JobAssign> .Update.Set(f => f.IsEnabled, message.IsEnabled), Builders <JobAssign> .Update.Set(f => f.Description, message.Description), Builders <JobAssign> .Update.Set(f => f.TillYear, message.TillYear), Builders <JobAssign> .Update.Set(f => f.RepeatsPerWeek, message.RepeatsPerWeek), Builders <JobAssign> .Update.Set(f => f.IsLocked, message.IsLocked), Builders <JobAssign> .Update.Set(f => f.CreatedByRole, message.CreatedByRole), Builders <JobAssign> .Update.Set(f => f.ChangedByRole, message.ChangedByRole), Builders <JobAssign> .Update.Set(f => f.WeekList, message.WeekList), Builders <JobAssign> .Update.Set(f => f.UploadList, message.UploadList), Builders <JobAssign> .Update.Set(f => f.DayPerWeekList, message.DayPerWeekList), Builders <JobAssign> .Update.Set(f => f.JobIdList, message.JobIdList), Builders <JobAssign> .Update.Set(f => f.IsGlobal, message.IsGlobal))); }
private void Apply(JobAssignCreatedFromGlobalEvent e) { Id = e.SourceId; HousingDepartmentIdList = e.HousingDepartmentIdList; IsEnabled = e.IsEnabled; Description = e.Description; TillYear = e.TillYear; RepeatsPerWeek = e.RepeatsPerWeek; IsLocked = e.IsLocked; CreatedByRole = e.CreatedByRole; ChangedByRole = e.ChangedByRole; WeekList = e.WeekList; UploadList = e.UploadList; DayPerWeekList = e.DayPerWeekList; JobIdList = e.JobIdList; IsGlobal = e.IsGlobal; }