Beispiel #1
0
        public override FbDTO Save_user(FbDTO dto)
        {
            using (var context = new PHCEntities())
            {
                FbDTO fb = new FbDTO();
                try
                {
                    User usr = new User();
                    usr.FirstName  = dto.Fname;
                    usr.LastName   = dto.Lname;
                    usr.Gender     = dto.Sex;
                    usr.Email      = dto.Email;
                    usr.fbid       = dto.fbid;
                    usr.acesstoken = dto.acctoken;
                    //    usr.Address = dto.Address;
                    //    usr.Link = dto.Link;

                    context.AddToUsers(usr);
                    context.SaveChanges();


                    fb.UID      = usr.UID;
                    fb.Email    = usr.Email;
                    fb.Fname    = usr.FirstName;
                    fb.acctoken = usr.acesstoken;
                    fb.fbid     = usr.fbid;
                }
                catch (Exception)
                {
                    throw;
                }
                return(fb);
            }
        }