public static void DeleteUser(string Email, string UserPermission) { if (UserPermission == "Broadcaster") { RadioBroadcastsController broadcastsController = new RadioBroadcastsController(); List <RadioBroadcast> myBroadcasts = broadcastsController.GetByEmail(Email); foreach (var broadcast in myBroadcasts) { broadcast.UserEmail = ""; broadcast.Username = ""; broadcastsController.Update(broadcast); } } LikesController likesController = new LikesController(); List <LikeBroadcast> myLike = new List <LikeBroadcast>(); myLike.AddRange(likesController.GetLikesByEmail(Email)); if (myLike.Count != 0) { foreach (var like in myLike) { likesController.Delete(like); } } CommentsController commentsController = new CommentsController(); List <BroadcastComment> myComments = new List <BroadcastComment>(); myComments.AddRange(commentsController.GetCommentsByEmail(Email)); if (myComments.Count != 0) { foreach (var comment in myComments) { commentsController.Delete(comment); } } }