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
Sanjay Sharma
1.3k
413
27.3k
string.Contains
Jun 20 2018 7:16 AM
Hi,
I have following data
I required function rows having functionId = 3 and not 13.
in c#
=================================
int FunctionId = 3;
var DFKeywords = entity.DefaultKeywords.Where(DF => DF.FunctionId.Contains(FunctionId.ToString())).ToList();
will include 3 as well as 13 too any quick solution to this?
Although I achived this as
=================================
int FunctionId = 3;
List<DefaultKeyword> DFKeywords = new List<DefaultKeyword>();
foreach (var item in entity.DefaultKeywords.Where(df=> df.FunctionId != null) .ToList())
{
var functionIds = item.FunctionId.Split(',');
if (functionIds.Contains(FunctionId.ToString()))
{
DFKeywords.Add(item);
}
}
Reply
Answers (
2
)
C# memory information
How To Select Only Non -Empty Columns in a SQL Table?