Ejemplo n.º 1
0
 public void InsertEmail([FromBody] UserEntity data)
 {
     _uecontext.Users.Add(new UserEntity
     {
         Email = data.Email
     });
     _uecontext.SaveChanges();
 }
Ejemplo n.º 2
0
 public void registerToDinderDB(string mail, string name)
 {
     _uecontext.Users.Add(new DinderDL.Models.UserEntity
     {
         Name  = name,
         Email = mail
     });
     _uecontext.SaveChanges();
 }
Ejemplo n.º 3
0
        public IActionResult UpsertProfilePic(User user)
        {
            if (Request.Form.Files.Count > 0)
            {
                IFormFile file = Request.Form.Files.FirstOrDefault();
                using (var dataStream = new MemoryStream())
                {
                    file.CopyTo(dataStream);
                    user.ProfilePic = dataStream.ToArray();
                }
            }
            var dbUser = _uecontext.Users.First(u => u.Email == User.Identity.Name);

            dbUser.ProfilePic = user.ProfilePic;

            _uecontext.SaveChanges();
            return(Redirect(Request.Headers["Referer"].ToString()));
        }