public async Task Handle(PhotoChanging command) { var obj = await Task.Run(() => Repository.GetById(command.Id)); Path.GetExtension(command.FileName); obj.SetPhoto(new ContactPhoto(command.Raw, ContactPhoto.TypeFromFileName(command.FileName))); await Task.Run(() => Repository.Update(obj)); EventDomainDispatcher.Dispatch(new PhotoChanged(obj.Id, obj.Photo)); }
public void SetPhoto(ContactPhoto photo) { Photo = photo; }
public PhotoChanged(Guid id, ContactPhoto contactPhoto) { CustomInfoId = id; Photo = contactPhoto; }
public Builder WithPhoto(ContactPhoto photo) { _entity.Photo = photo; return(this); }