Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7779767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:43:19+00:00 2026-06-01T18:43:19+00:00

My class is showing compilation errors: namespace Zone.Models { using System; using System.Collections.Generic; using

  • 0

My class is showing compilation errors:

namespace Zone.Models
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.Web;
    using System.Web.Mvc;
    using Zone.Models;


    public class MyViewModel
    {
       public MyInfo Info { get; set; }
       public PageNumberResults { get; set; }

    }
}

The errors that am getting are the following:

Error 1 Invalid token '{' in class, struct, or interface member declaration 
Error 2 Invalid token ';' in class, struct, or interface member declaration
Error 3 Invalid token ';' in class, struct, or interface member declaration 
Error 4 Type or namespace definition, or end-of-file expected

My controller shows how the games are entered within the database through an interface:

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using PagedList;
using System.Web.Mvc;
using Zone.Models;

namespace Zone.Controllers
{ 
    public class GameController : Controller
    {
        private mydbEntities db = new mydbEntities();



        public ViewResult Index(string Ordering, int? CounterForPage)
        {

            var FullDatabaseItem = from b in db.tblGames
                                   select b;

            var Info = db.tblGames.Include(x => x.tblConsole).Where(UserInfo => UserInfo.UserName.Equals(User.Identity.Name)).ToList();

            switch (Ordering)
            {
                case "HeadlineName":
                    FullDatabaseItem = FullDatabaseItem.OrderBy(b => b.GameName);
                    break;
                case "DatePosted":
                    FullDatabaseItem = FullDatabaseItem.OrderBy(b => b.ReleaseYear);
                    break;
                case "DiscriptionDate":
                    FullDatabaseItem = FullDatabaseItem.OrderBy(b => b.ReleaseYear);
                    break;
                default:
                    FullDatabaseItem = FullDatabaseItem.OrderByDescending(b => b.ReleaseYear);
                    break;
            }

            int pageSize = 3;
            int pageNumber = (CounterForPage ?? 1);
            var PageNumberResults = FullDatabaseItem.ToPagedList(pageNumber, pageSize);

            if (PageNumberResults.Any())
            {

                return View(new MyViewModel()
                {
                    Info = info,
                    PageNumberResults = FullDatabaseItem.Count()
                });
            }

            return View("ErrorView");
        }
    }
}

Any help would be appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T18:43:20+00:00Added an answer on June 1, 2026 at 6:43 pm

    You’re missing the type in the second property:

       public ??? PageNumberResults { get; set; } 
    

    and you don’t need the using Zone.Models; declaration, because your class is in that namespace.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

class Achievement(MyBaseModel): parent_achievement = models.ForeignKey('self', blank=True, null=True, help_text=An achievement that must be done before
I'm having small problem (I guess) of showing the JTable panel. I have class
I have a generic methode like this one: public class ClassName { public <T>
I am showing my code first <div class = buttonsHolder> <asp:Button runat = server
I have this MapActivity class below showing a map and putting a pin of
I am working on MVC and in the model I created a class that
Here's my NHibernate mapping. <?xml version=1.0 encoding=utf-8 ?> <hibernate-mapping xmlns=urn:nhibernate-mapping-2.2 assembly=HelloNHibernate namespace=HelloNHibernate> <class name=Showing
I am showing a modal view which is a UITableViewController class. For some reason
Why is the UI not showing up in my code below: public class GUI
A warning is showing every time I synchronize on a non-final class field. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.