Note that there are some explanatory texts on larger screens.

plurals
  1. POUsers with different capabilities
    primarykey
    data
    text
    <p>I'm creating an ASP.Net MVC 5 application. In my website, 3 different types of users exist.</p> <ul> <li>Admin</li> <li>Normal users</li> <li>Restaurants</li> </ul> <p>Each of these users have its own capabilities and access rights. Meaning, the view for each of them should be different.</p> <p>I have created the models for both of the normal and restaurant. I was wondering how I can modify my existing structure to support this functionality.</p> <pre><code>public class User : IUser { public User() : this(String.Empty) { } public User(string userName) { UserName = userName; Id = Guid.NewGuid().ToString(); } [Key] public string Id { get; set; } [Required] public string UserName { get; set; } [Required] public string FirstName { get; set; } [Required] public string LastName { get; set; } public string Phone { get; set; } public string MobilePhone { get; set; } [Required] [DataType(DataType.EmailAddress)] public string Email { get; set; } public virtual IList&lt;UserAddress&gt; Addresses { get; set; } } public class Restaurant { [Key] public int ID { get; set; } [Required] public string Name { get; set; } public virtual IList&lt;RestaurantAddress&gt; Addresses { get; set; } public virtual IList&lt;RestaurantFood&gt; Menu { get; set; } public virtual IList&lt;Review&gt; Reviews { get; set; } [DataType(DataType.Url)] public string Website { get; set; } [DataType(DataType.PhoneNumber)] public string Phone { get; set; } [DataType(DataType.PhoneNumber)] public string Fax { get; set; } [DataType(DataType.EmailAddress)] public string Email { get; set; } public int Seats { get; set; } public double AverageRating { get; set; } public double AveragePrice { get; set; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload