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 887543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:14:47+00:00 2026-05-15T13:14:47+00:00

i having error throw on View page and i think i am passing wrong

  • 0

i having error throw on View page and i think i am passing wrong type, can anybody please correct me – thanks.

The model item passed into the dictionary is of type ‘System.Collections.Generic.List1[App.Domain.Model.Interface.IPerson]' but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable1[App.Domain.Service.PersonService]’.

MyService looks like this….

namespace App.Domain.Service
{
    public class PersonService :  IPersonService
    { 
        private IPersonRepository _personRepository;
        public PersonService(IPersonRepository personRepository)
        {
            _personRepository = personRepository; 
        }

        public List<IPerson> GetPerson()
        {            
            return _personRepository.GetHost();
        } 
    }
}

myView look like this…

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" 
Inherits="System.Web.Mvc.ViewPage<IEnumerable<App.Domain.Service.PersonService>>" %>

my controller look like this…

 public ActionResult GetPersons()
        {
            IPersonRepository personRepo = new PersonRepository();
            PersonService person = new PersonService(personRepo);
            IList<IPerson> p  = person.GetPerson(); 
            return View(p);
        }
  • 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-05-15T13:14:47+00:00Added an answer on May 15, 2026 at 1:14 pm

    You are sending the wrong type to the View()
    In your View decleration says App.Domain.Service.PersonService, but in your View you are sending it a View(IPerson).
    If you want to send an IPerson to your view the tag should read like:

    <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<App.Domain.Model.Interface.IPerson>>" %> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having this error page in Django. Exception Type: IndexError Exception Value: list index
I'm having the error Data may still be loading. Drag or refresh the page
I am having this error on my page. iisnode encountered an error when processing
I'm having a weird error thrown when I try to use @Secured or @PreAuthorize
here is the part if having error. Fatal error: Using $this when not in
I`m having the following error . Why am I having this error and how
I'm having the error Unable to instantiate activity ComponentInfo in my app. I had
I am having an error: Error 2 'int[]' does not contain a definition for
I am having this error in my j2ee web application. java.sql.SQLException: ORA-00604: error occurred
I'm currently having following error message when executing a .sql file with about 26MB

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.