Cannot implicitly convert type 'User' to 'System.Web.Security.MembershipUser' in ASP.NET MVC 4 -
i'm facing error cannot implicitly convert type 'user' 'system.web.security.membershipuser'
in asp.net mvc 4 application while using custom membership provider.
here custom membership provider class , getuser method raising error.
public class invoicingmembershipprovider : system.web.security.membershipprovider { private invoicedb db = new invoicedb(); ::::::::::::: public override system.web.security.membershipuser getuser(string username, bool userisonline) { var user = db.users.where(u => u.name == username).firstordefault(); return user; } :::::::::::: }
please let me know how cast user object membershipuser object?
public override system.web.security.membershipuser getuser(string username, bool userisonline) { system.web.security.membershipuser user = db.users.where(u => u.name == username).firstordefault(); return user; }
Comments
Post a Comment