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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:43:36+00:00 2026-06-06T15:43:36+00:00

I have a Model that named word. this is my word model public class

  • 0

I have a Model that named word.

this is my word model

public class Word : BaseFieldsTables
{
    int ID { get; set; }
    string Name { get; set; }
    Guid UniqID { get; set; }
    DateTime CreatedDate { get; set; }
    byte[] RowVersion { set; get; }
    public string Text { get; set; }
    public virtual Category Category { get; set; }
    public int CategoryID { get; set; }
    public virtual Language Language { get; set; }
    public int LanguageID { get; set; }

    public virtual ICollection<Picture> Pictures { get; set; }

    [InverseProperty("MainWord")]
    public virtual ICollection<RelationshipBetweenWords> MainWords { get; set; }

    [InverseProperty("RelatedWord")]
    public virtual ICollection<RelationshipBetweenWords> RelatedWords { get; set; }
}

word has a category and language and…

for example this is my language model

    public class Language : BaseFieldsTables
    {
       int ID { get; set; }
        string Name { get; set; }
        Guid UniqID { get; set; }
        DateTime CreatedDate { get; set; }
        byte[] RowVersion { set; get; }
        public virtual ICollection<Word> Words { get; set; }
    }

i have word word viewmodel like this

public class WordViewModel

    public string Name { get; set; }


    public IList<SelectListItem> Categories { set; get; }


    [HiddenInput(DisplayValue = false)]
    public int SelectedCategoryID { set; get; }


    public IList<SelectListItem> Languages { set; get; }



    [HiddenInput(DisplayValue = false)]
    public int SelectedLanguageID { set; get; }
}

and this my controller

public ActionResult Index(
    {
        IList<Word> list = _wordService.GetAll();

    }

i want to get all word and map(auotomapper) to my WordViewModel with languagename and category name and return in my view please help me if i have to change my wordviewmodel or… and how to map.tnx

  • 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-06T15:43:38+00:00Added an answer on June 6, 2026 at 3:43 pm

    oh i found it

    public ActionResult Index()
            {
                var orders = _respository.GetAll();
    
                AutoMapper.Mapper.CreateMap<Order, OrderDto>()
                    .ForMember(dest => dest.OrderNumber, opt => opt.MapFrom(src => src.OrderNo))
                    .ForMember(dest => dest.OrderItemsDto, opt => opt.Ignore());
    
                var model = AutoMapper.Mapper.Map<IEnumerable<Order>, IEnumerable<OrderDto>>(orders);
    
                return View(model);
            }
    //Razor View Code
    <h2>Orders</h2>
    <table>
        <tr>
            <th>Order Number</th>
            <th>Name</th>
            <th>Total</th>
        </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>@item.OrderNumber</td>
            <td>@item.CustomerName</td>
            <td>$@item.Total</td>
        </tr>
    }
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one grails application.In that I have one model class named Book. From
I have that situation: I have models Item, Region and Country. class Item(models.Model): name
I have a model that looks like: [Serializable] public class TemplatePageModel { public PageModel
I have a model that is something like this: class Input(models.Model): details = models.CharField(max_length=1000)
I wasn't sure how to word this exactly. But I have a model that
I have a model that holds user address. This model has to have first_name
I have a model that looks like this: Performance - Location - Event -
I have an object, RenderComponent , that has a property named Model that is
I have a model that I would like to contain a subjects name and
Let's suppose I have a Word model with this schema var Word = new

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.