Exemplo n.º 1
0
        public async Task <IActionResult> CreateProfile([FromBody] ProfileResource profileResource)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var profile = mapper.Map <ProfileResource, Core.Models.Profile>(profileResource);

            profile.MovingDate = DateTime.Now;

            await repository.AddProfileAsync(profile);

            await uow.CompleteAsync();

            return(Ok(mapper.Map <Core.Models.Profile, ProfileResource>(profile)));
        }