Example #1
0
        public async Task<IHttpActionResult> profile()
        {


            if (!Request.Content.IsMimeMultipartContent())
            {
                return StatusCode(HttpStatusCode.UnsupportedMediaType);
            }

            var filesReadToProvider = await Request.Content.ReadAsMultipartAsync();
            UserService us = new UserService(new CTX());
            foreach (var stream in filesReadToProvider.Contents)
            {
                byte[] fileBytes = await stream.ReadAsByteArrayAsync();
       
               
                us.User.picture = Convert.ToBase64String(fileBytes);


                us.Update(us.User);
               
            }

            return Json(us.GetPicture());

        }
Example #2
0
        public IHttpActionResult save( [FromBody] DBUser user)
        {
            UserService us = new UserService(User, ctx);
              us.Update(user);

              return Json(user);
        }
Example #3
0
        IActionResult IUserController.save( [FromBody] DBUser user)
        {


          UserService us = new UserService( ctx);
          us.Update(user);

          return Json(user);

        }