Last active
August 29, 2015 13:57
-
-
Save mrcnkoba/9398489 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Execute(UploadPhotoCommandHandler, ...) | |
{ | |
... | |
var profile = ...; | |
.. //some validations if profile exists and so on | |
profile.UploadPhoto(@command.photo); | |
_profileRepository.Save(profile); | |
} | |
... | |
... | |
... | |
public class Profile | |
{ | |
public Guid Id { get; private set; } | |
public Photo Photo { get; private set; } | |
... | |
... | |
... | |
public void UploadPhoto(Photo photo) | |
{ | |
if (photo.Size > sth && photo.MimeType != "image/jpeg") | |
{ | |
throw new ArgumentException("some msg"); | |
} | |
Photo = photo; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment