vendredi 20 novembre 2015

display current user data in MVC

In MVC i want to authenticate users,they must not be able to see other user data when logged on. Users must be able to CRUD their own data only. I have created two model:

public class User
{
    public int id { get; set; }
    public string Username { get; set; }
    public string Firstname { get; set; }
    public string Lastname { get; set; }

    public List<Product> Products { get; set; }
}


public class Product
{
    public int productId { get; set; }
    public string productName { get; set; }
    public double productPrice { get; set; }

    public User Users { get; set; }
}

And i have product controller, where i want to authenticate users from CRUD other users data.

Aucun commentaire:

Enregistrer un commentaire