예제 #1
0
        public void Create(AnimeId oId, AnimeName oName, StudioId oStudioId)
        {
            var oAnime = Anime.Create(oId, oName, oStudioId);

            _oAnimeRepository.Save(oAnime);
            //TODO: publish events here
        }
        public static Anime Create(AnimeId oId, AnimeName oName, StudioId oStudioId)
        {
            var oAnime = new Anime(oId, oName, oStudioId);

            //TODO: implement event sourcing here

            return(oAnime);
        }
        public Task <Unit> Handle(AnimeCreateCommand request, CancellationToken cancellationToken)
        {
            var id       = new AnimeId(Guid.Parse(request.AnimeId));
            var name     = new AnimeName(request.AnimeName);
            var studioId = new StudioId(Guid.Parse(request.StudioId));

            AnimeCreator.Create(id, name, studioId);

            return(new Task <Unit>(() => Unit.Value));
        }
예제 #4
0
 public override string ToString()
 {
     return(AnimeId.ToString());
 }
예제 #5
0
 public void Delete(AnimeId id)
 {
 }
 public Anime(AnimeId oId, AnimeName oAnimeName, StudioId oStudioId)
 {
     Id       = oId;
     Name     = oAnimeName;
     StudioId = oStudioId;
 }
예제 #7
0
 public override int GetHashCode()
 {
     return(AnimeId.GetHashCode());
 }