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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:19:31+00:00 2026-05-26T23:19:31+00:00

I am trying to learn about the Orchard MVC application. I see the following

  • 0

I am trying to learn about the Orchard MVC application. I see the following code but cannot understand what it is doing. Can someone explain what this:

User.As<UserPart>().Record.UserName = value;

means?

 public class UserEditViewModel  {
    [Required]
    public string UserName {
        get { return User.As<UserPart>().Record.UserName; }
        set { User.As<UserPart>().Record.UserName = value; }
    }

    [Required]
    public string Email {
        get { return User.As<UserPart>().Record.Email; }
        set { User.As<UserPart>().Record.Email = value; }
    }

    public IContent User { get; set; }
}
  • 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-26T23:19:32+00:00Added an answer on May 26, 2026 at 11:19 pm

    Not knowing the source, it looks like the call to As<type>() is equivalent to obj as type

    i.e. the object is being cast as a type type — UserPart in this case. So User is defined as IContent but in this case it is assumed that the class implementing that interface is of type UserPart and can be safely converted to that type.

    So User.As<UserPart>() returns an object of type UserPart which presumably has a property Record on it.

    It seems odd to me, because why abstract the IContent interface if you are tying the implementation to the type UserPart, but again, I don’t know the code and it could well make sense in the greater context.

    edit: I say tying the implementation, because presumably User.As<UserPart>() could return null if the underlying class is not of type UserPart, and there’s no check for that.

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

Sidebar

Related Questions

I'm trying to learn about regular expressions but am not doing so well after
I am trying to learn about the Jini API in java, but can't get
I'm trying to learn about this feature of javascript I keep seeing in code,
I am currently trying to learn about OpenGL ES for the iPhone and following
I am trying to learn about all possible conditionals that can be used on
I'm trying to learn about shift-reduce parsing. Suppose we have the following grammar, using
I'm trying to learn about grails with Google App Engine and JPA by following
I am trying to learn about dependency injection and i'm using the unity application
I'm trying to learn about MVC and I'm confused about where to put business
I'm trying to learn about reverse engineering, using Minesweeper as a sample application. I've

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.