I am trying to follow the tutorial listed here: Link
And when I insert the below code
public ApplicationUser()
{
UserUpload = new HashSet(); } public ICollection UserUpload { get; set; }
}
into the ApplicationUser class of IdentityModels.cs I get the folloiwing error:
'Cannot implicitly convert type 'System.Collections.Generic.HashSet' to 'System.Collections.Generic.ICollection'. An explicit conversion exists (Are you missing a cast?).
I am very new to programming and have no idea what to do! Any help would be appreciated, thanks. Whole code is below. It's built on MVC 5 in VS 2015.
using System.Data.Entity;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using System.Collections.Generic;
namespace ENUSecretShare.Models
{
// You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
public class ApplicationUser : IdentityUser
{
public string FName { get; set; }
public string LName { get; set; }
public int nValue { get; set; }
public int tValue { get; set; }
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
public ApplicationUser()
{
UserUpload = new HashSet(); } public ICollection UserUpload { get; set; }
}
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext()
: base("DefaultConnection", throwIfV1Schema: false)
{
}
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
}
}