Пример #1
0
        public async Task <Studio> CreateStudio(StudioToPost studioToPost)
        {
            var addStudio = new Studio
            {
                Name  = studioToPost.Name,
                City  = studioToPost.City,
                State = studioToPost.State
            };

            _context.Studios.Add(addStudio);
            await _context.SaveChangesAsync();

            return(addStudio);
        }
Пример #2
0
        public async Task <IActionResult> CreateStudio([FromBody] StudioToPost studio)
        {
            var result = await _studioRepository.CreateStudio(studio);

            return(Ok(result));
        }