示例#1
0
        public UserBehaviorDatabase LoadUserBehaviorDatabase(List <Databases.DomainModel.RecommenderAction> actions)
        {
            UserBehaviorDatabase db    = new UserBehaviorDatabase();
            MongodbFunctions     mongo = new MongodbFunctions();

            db.Categories = mongo.GetCategories();
            db.Users      = mongo.GetUsers();
            db.Products   = mongo.GetProducts();

            foreach (Databases.DomainModel.RecommenderAction a in actions)
            {
                db.UserActions.Add(new Objects.UserAction(a.Action, a.UserId, a.ProductId, a.Grade));
            }

            return(db);
        }