TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Steven Langston
NA
15
590
for each if break
Mar 12 2021 10:29 AM
I need this code to not add the draft document to the list if the loged in user is not the documents author.
Should it work?
var listofdocuments = dbContext.Documents.ToList();
var filtered =
new
List<Document> () ;
foreach
(var document
in
listofdocuments)
{
if
(document.IsDraft)
{
if
(document.Author == User.FindFirst(ClaimTypes.NameIdentifier).Value)
{
filtered.Add(document);
}
else
break
;
}
filtered.Add(document);
}
Reply
Answers (
4
)
Press save button but no action is taken.
Change the color of text in richtextbox uisng string builder