Beispiel #1
0
        public void DeleteSocial(Guid guid)
        {
            var social = Socials.SingleOrDefault(s => s.Guid == guid);

            if (social == null)
            {
                throw new CvException($"There is no social associated this id -> {guid}");
            }

            Socials.Remove(social);
        }
Beispiel #2
0
        public IActionResult AddSocials(string num, [FromBody] Socials socials)
        {
            User user = _repository.Users.GetByNumber(num, false);

            if (user == null)
            {
                return(NotFound());
            }

            _repository.Socials.AddSocials(socials);
            _repository.Save();
            return(Ok(NoContent()));
        }