DeleteUser Method for Entity Framework MVC3 Razor Custom Member Provider C# Using LINQ
public override bool DeleteUser(string username, bool deleteAllRelatedData)
{
// deleteAllRelatedData not implemented
try
{
using (var context = new SSSEntities())
{
UserProfile u = context.UserProfiles
.SingleOrDefault(up => up.UserName == username);
context.UserProfiles.DeleteObject(u);
context.SaveChanges();
return true;
}
}
catch
{
return false;
}
[SIGNATURE]