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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:26:54+00:00 2026-05-30T00:26:54+00:00

In my ASP.NET web site users model, I want both Guid Id ‘s and

  • 0

In my ASP.NET web site users model, I want both Guid Id‘s and String UserNames to be unique. I am going to map my model objects to a DB using Entity Framework.

Is there a build-in attribute or some other mechanism that facilitates this common constraint in ASP.NET MVC? Or am I bound to manually checking user name uniqueness at user register form?

  • 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-30T00:26:56+00:00Added an answer on May 30, 2026 at 12:26 am

    Firstly, in my opinion, MVC, or your front end application shouldn’t be responsible for doing this.

    Unique Id and unique Username are the constraints that should be enforced on the database, otherwise, you are making an assumption that the only way to register users is from your website.

    Entity framework has attributes for enforcing unique constraints. More info here: http://blogs.msdn.com/b/efdesign/archive/2011/03/09/unique-constraints-in-the-entity-framework.aspx

    Finally, regarding the Ids of your users, I would consider auto generating these within the database, rather then your front end application.

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

Sidebar

Related Questions

I used to have an embedded user control in an ASP.NET web site which
When I worked on asp.net mvc web site project, I investigated different approaches for
I am working on a Asp.Net MVC 3/knockout.js site for several users where they
My web-site is working under ASP.NET 3.5, IIS7, Integrated pipiline mode. My HttpModule is
I'm building a web site (using ASP.NET, MVC 3, Razor) and I'm not using
What I want to do is: Allow anonymous users to access my ASP .NET
I have an ASP.NET 4 site with url's having session string embedded in them.
I had wrote a web site using asp.net mvc3 and used Membership class for
I have a forms login in my web site using ASP.NET MVC with C#.
last year i developed an ASP.NET Application implenting MVP Model. The site is not

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.