Пример #1
0
        public async Task Update(long id, FilmPersonFormModel model)
        {
            var entity = await Unit.FilmPeople.Get(id);

            Mapper.Map(model, entity);

            await Unit.Complete();
        }
Пример #2
0
        public async Task <IActionResult> Update(long id, [FromBody] FilmPersonFormModel model)
        {
            if (!await People.CheckIfExists(id))
            {
                return(NotFound());
            }
            await People.Update(id, model);

            return(Ok());
        }
Пример #3
0
        public async Task <long> Add(FilmPersonFormModel model)
        {
            var entity = Mapper.Map <FilmPerson>(model);

            entity.PublicId = Guid.NewGuid().ToString();
            await Unit.FilmPeople.Add(entity);

            await Unit.Complete();

            return(entity.Id);
        }
Пример #4
0
 public async Task <IActionResult> Add([FromBody] FilmPersonFormModel model)
 {
     return(Ok(await People.Add(model)));
 }