Im trying to delete a member from the frontend, letting the member delete his account.
Im doing
var member = Members.GetCurrentMember();
if(member != null)
{
member.Delete();
umbraco.library.RefreshContent();
}
But i'm getting: 'Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'Delete' and no extension method 'Delete' accepting a first argument of type 'Umbraco.Core.Models.IPublishedContent' could be found (are you missing a using directive or an assembly reference?)
var member = Members.GetCurrentMember();
var memberFromDatabase = ApplicationContext.Services.MemberService.GetById(member.Id);
ApplicationContext.Services.MemberService.Delete(memberFromDatabase);
Services are for making db changes as create, edit or remove
It deletes the member all right, but throws this error:
System.IO.IOException: The process cannot access the file 'D:\WEB\sitename.dk\www\App_Data\TEMP\ExamineIndexes\Internal\Index\write.lock' because it is being used by another process.
Delete member from Razor
Im trying to delete a member from the frontend, letting the member delete his account.
Im doing
But i'm getting:
'Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'Delete' and no extension method 'Delete' accepting a first argument of type 'Umbraco.Core.Models.IPublishedContent' could be found (are you missing a using directive or an assembly reference?)
What gives?
Hi
Use this code:
Services are for making db changes as create, edit or remove
Thanks,
Alex
Hello, Is it a physical or logical deletion of the member from the database?
Thanks
Thanks
It deletes the member all right, but throws this error:
System.IO.IOException: The process cannot access the file 'D:\WEB\sitename.dk\www\App_Data\TEMP\ExamineIndexes\Internal\Index\write.lock' because it is being used by another process.
What line gives this error?
ApplicationContext.Services.MemberService.Delete(memberFromDatabase);
Try to rebuild Examine indexes.
Bingo :)
is working on a reply...