示例#1
0
 public static bool Validate (BaseRestPostModel model, WebDbContext db , out Xiake  account,params string[] includies)
 {
     IQueryable<Xiake > query = includies.Aggregate<string, IQueryable<Xiake >>(db.Xiakes , (current, include) => current.Include(include));
     var acc = query.FirstOrDefault(a => a.Id  == model.XiakeID); 
     account = acc;
     if(acc == null)
         throw new JsonException(Resources.ErrorReLogin);
     if(! XCodeHelper.ValidateXCode(model, acc.Token))
         throw new JsonException(Resources.ErrorReLogin);
     return true;
 }
示例#2
0
 public static bool Validate(BaseRestPostModel model, WebDbContext db)
 {
     Xiake  acc = null;
     
     return Validate(model, db, out acc);
 }