コード例 #1
0
        public async Task <CollectionModel> AddCollectionAsync(AddCollectionInput model, long currentUserId)
        {
            var entity = new MovieCollection
            {
                Name   = model.Name,
                UserId = currentUserId
            };

            await collectionMovieRepo.AddAsync(entity);

            return(ConvertEntityToCollectionModel(entity));
        }
コード例 #2
0
        public async Task <IActionResult> AddCollection([FromBody] AddCollectionInput model)
        {
            try
            {
                var result = await collectionLib.AddCollectionAsync(model, CurrentUserId);

                return(CustomResult(result));
            }
            catch (System.Exception exp)
            {
                return(CustomError(exp));
            }
        }