Exemple #1
0
 public ActionResult CreateUser(EspadanaUserDto user)
 {
     try
     {
         return(Ok(_service.CreateEspadanaUser(user)));
     }
     catch (Exception)
     {
         throw new ApplicationException();
     }
 }
        public Guid CreateEspadanaUser(EspadanaUserDto user)
        {
            var Id = Guid.NewGuid();

            _context.EspadanaUsers.Add(new EspadanaUser()
            {
                Id               = Id,
                Name             = user.Name,
                CreationDate     = DateTime.Now,
                LastModifiedDate = DateTime.Now,
            });
            _context.SaveChanges();
            return(Id);
        }