Exemple #1
0
        public async Task <Guid> AddAsync(AddActorDto addActor)
        {
            var newActor = new Person(addActor.Name, addActor.LastName);

            await _ctx.Actors.AddAsync(newActor);

            await _ctx.SaveChangesAsync();

            return(newActor.Id);
        }
Exemple #2
0
        public async Task <Guid> AddAsync(AddMovieDto movie)
        {
            var newMovie = new Movie(movie.Title)
            {
                Description = movie.Description
            };

            await _ctx.Movies.AddAsync(newMovie);

            await _ctx.SaveChangesAsync();

            return(newMovie.Id);
        }