Пример #1
0
 public ResponseMessageWrap <int> Update([FromBody] Popedom popedom)
 {
     return(new ResponseMessageWrap <int>
     {
         Body = PopedomService.Update(popedom)
     });
 }
Пример #2
0
 public ResponseMessageWrap <int> Insert([FromBody] Popedom popedom)
 {
     return(new ResponseMessageWrap <int>
     {
         Body = PopedomService.Insert(popedom)
     });
 }
Пример #3
0
        /// <summary>
        /// Finds the user by subject identifier.
        /// </summary>
        /// <param name="subjectId">The subject identifier.</param>
        /// <returns></returns>
        public TestUser FindBySubjectId(string subjectId)
        {
            TestUser testUser = new TestUser();
            Popedom  popedom  = dbContext.Popedom.Where(c => c.Userid == subjectId).FirstOrDefault();

            if (popedom != null)
            {
                testUser.SubjectId = popedom.Userid;
                testUser.Claims    = new List <Claim>()
                {
                    new Claim("name", popedom.Username),
                    new Claim("sysId", popedom.Userid),
                    new Claim("nationality", "中国")
                };
            }
            return(testUser);
        }
Пример #4
0
        /// <summary>
        /// Finds the user by username.
        /// </summary>
        /// <param name="username">The username.</param>
        /// <returns></returns>
        public TestUser FindByUsername(string username)
        {
            //dbContext.Popedom.AsEnumerable().(c => c.LoginName == username);
            TestUser testUser  = new TestUser();
            var      queryable = dbContext.Popedom.Select(c => c.LoginName == username);
            Popedom  popedom   = dbContext.Popedom.FirstOrDefault(c => c.Username == username);

            if (popedom != null)
            {
                testUser.SubjectId = popedom.Userid;
                testUser.Claims    = new List <Claim>()
                {
                    new Claim("name", popedom.Username),
                    new Claim("sysId", popedom.Userid),
                    new Claim("nationality", "中国")
                };
            }
            return(testUser);
        }
Пример #5
0
 public int Update(Popedom popedom)
 {
     return(PopedomRepository.Update(popedom));
 }
Пример #6
0
 public int Insert(Popedom popedom)
 {
     return(PopedomRepository.Insert(popedom));
 }