Profile image.net.net mvc identity user profile

I am building a web application using MVC 5 and Identity. I have so far created a registration system, but I would like to allow users to upload a profile during registration.

I was wondering if it is possible to implement profile images with asp.net id?

+4
source share
2 answers

It is best to add a second table (or add a column to the current table), add a file upload function to the registration form. When registration is successful, add the image in db using EntityFramework. Create a page to return the image with a user ID so you can include it on the page somewhere.

Something like http://blogs.msdn.com/b/webdev/archive/2013/10/16/customizing-profile-information-in-asp-net-identity-in-vs-2013-templates.aspx , but with a profile picture

0
source

Yes. Assuming you are using a standard implementation of the Entity Framework, you can expand ApplicationUserin a file named Models/IdentityModels.cs.

.

- (, , varbinary(max))...

public class ApplicationUser : IdentityUser
{
    public byte[] Image { get; set; }
}

, EF, ... Entity Framework 5

blob, URL- ...

public class ApplicationUser : IdentityUser
{
    public string ImagePath { get; set; }
}
+8

Source: https://habr.com/ru/post/1525852/


All Articles