Ejemplo n.º 1
0
        public Task AddAsync(Guid userId, int id, string title, string artist, string photo)
        {
            var track = Track.Create(userId, id, title, artist, photo);

            tracksRepository.AddFavourite(track);
            return(unitOfWork.CommitAsync());
        }
Ejemplo n.º 2
0
        public async Task CreateAsync(
            Guid userId, string title, bool isPrivate, string description, string image, TimeSpan?duration, int?servings, string notes,
            IList <Ingredient> ingredients, IList <Step> steps, IList <Tag> tags)
        {
            var recipe     = Recipe.Create(userId, title, isPrivate, description, image, duration, servings, notes, ingredients, steps);
            var recipeTags = await CreateRecipeTags(recipe, tags);

            recipe.AddTags(recipeTags);

            recipesRepository.Add(recipe);
            await unitOfWork.CommitAsync();
        }
Ejemplo n.º 3
0
 public async Task AddAsync(CartItem item)
 {
     cartRepository.Add(item);
     await unitOfWork.CommitAsync();
 }