コード例 #1
0
        public async Task <Video> CreateVideo(Video video)
        {
            _videosContext.Video.Add(video);
            var rows = await _videosContext.SaveChangesAsync();

            if (rows > 0)
            {
                return(video);
            }

            throw new Exception("There was an error creating video");
        }