public IHttpActionResult DeleteUserDetails(string user) { GroupsRepository _GroupsRepository = new GroupsRepository(); GroupMembersRepository _GroupMembersRepository = new GroupMembersRepository(); GroupProfileRepository _GroupProfileRepository = new GroupProfileRepository(); TaskRepository _TaskRepository = new TaskRepository(); TaskCommentRepository _TaskCommentRepository = new TaskCommentRepository(); InboxMessagesRepository _InboxMessagesRepository = new InboxMessagesRepository(); FacebookAccountRepository _FacebookAccountRepository = new FacebookAccountRepository(); GoogleAnalyticsAccountRepository _GoogleAnalyticsAccountRepository = new GoogleAnalyticsAccountRepository(); GooglePlusAccountRepository _GooglePlusAccountRepository = new GooglePlusAccountRepository(); InstagramAccountRepository _InstagramAccountRepository = new InstagramAccountRepository(); LinkedInAccountRepository _LinkedInAccountRepository = new LinkedInAccountRepository(); LinkedinCompanyPageRepository _LinkedinCompanyPageRepository = new LinkedinCompanyPageRepository(); ScheduledMessageRepository _ScheduledMessageRepository = new ScheduledMessageRepository(); SocialProfilesRepository _SocialProfilesRepository = new SocialProfilesRepository(); TwitterAccountRepository _TwitterAccountRepository = new TwitterAccountRepository(); TumblrAccountRepository _TumblrAccountRepository = new TumblrAccountRepository(); YoutubeAccountRepository _YoutubeAccountRepository = new YoutubeAccountRepository(); YoutubeChannelRepository _YoutubeChannelRepository = new YoutubeChannelRepository(); try { Domain.Socioboard.Domain.User _User = userrepo.getUserInfoByEmail(user); if (_User != null) { List <Domain.Socioboard.Domain.Groups> lstGroups = _GroupsRepository.getAllGroups(_User.Id); foreach (Domain.Socioboard.Domain.Groups item_group in lstGroups) { int i = _GroupMembersRepository.DeleteGroupMember(item_group.Id.ToString()); int j = _GroupProfileRepository.DeleteAllGroupProfile(item_group.Id); bool rt = _GroupProfileRepository.DeleteGroupReport(item_group.Id); int k = _TaskRepository.DeleteTaskOfGroup(item_group.Id); } int g = _GroupMembersRepository.DeleteGroupMemberByUserId(user); int h = _GroupsRepository.DeleteGroupsByUserid(_User.Id); int l = _TaskCommentRepository.DeleteTaskCommentByUserid(_User.Id); int m = _InboxMessagesRepository.DeleteInboxMessages(_User.Id); int n = _FacebookAccountRepository.DeleteAllFacebookAccount(_User.Id); int o = _GoogleAnalyticsAccountRepository.DeleteGoogleAnalyticsAccountByUserid(_User.Id); int p = _GooglePlusAccountRepository.DeleteGooglePlusAccountByUserid(_User.Id); int q = _InstagramAccountRepository.DeleteInstagramAccountByUserid(_User.Id); int r = _LinkedInAccountRepository.DeleteLinkedInAccountByUserid(_User.Id); int s = _LinkedinCompanyPageRepository.DeleteLinkedinCompanyPage(_User.Id); int t = _ScheduledMessageRepository.DeleteScheduledMessageByUserid(_User.Id); int u = _SocialProfilesRepository.DeleteSocialProfileByUserid(_User.Id); int v = _TwitterAccountRepository.DeleteTwitterAccountByUserid(_User.Id); int w = _TumblrAccountRepository.DeletetumblraccountByUserid(_User.Id); int x = _YoutubeAccountRepository.DeleteYoutubeAccount(_User.Id); int y = _YoutubeChannelRepository.DeleteYoutubeChannelByUserid(_User.Id); int z = userrepo.DeleteUser(_User.Id); } else { return(Ok(false)); } } catch (Exception ex) { return(BadRequest(ex.StackTrace)); } return(Ok(true)); }