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
FK DS
NA
3
1.1k
How to correct this porblem?
Jan 24 2015 3:19 PM
Here I wanted to save or update the result and precedent_case entities. I don't know why is not working or what still left behind the code? Can someone check for me and help me, please. Thank you so much.
public aSite[] returnLocalResult(string callerID, string query, string queryType)
{
LocalPrecedentEntities _local = new LocalPrecedentEntities();
SES1 ses1 = new SES1();
var precedent = from p in _local.Precedent__case_.AsEnumerable()
where ses1.FindSES1(query.ToLower(), p.Query.ToLower()) > 80
select p;
if (precedent.Count() <= 0)
{
var iSites = this.getSitesFromDB(query, queryType);
return iSites;
}
else
{
var sites = new List<string>();
Precedent__case_ Pc = new Precedent__case_
{
CaseId = _local.Precedent__case_.Count() + 1,
Query = query,
Username="NEW"
};
_local.Precedent__case_.AddObject(Pc);
_local.SaveChanges();
foreach (var p in precedent)
{
var pRes = from res in _local.Result
where res.CaseId == p.CaseId
select res;
foreach (var si in pRes)
{
int i = _local.Result.Count();
i = i + 1;
Result pR = new Result
{
ResultId = i,
SiteId = si.SiteId,
CaseId = Pc.CaseId,
SES = si.SES*(float)ses1.FindSES1(query.ToLower(), p.Query.ToLower())/100
};
_local.Result.AddObject(pR);
}
var pSite = from r in _local.Result
where r.CaseId == p.CaseId
select r.SiteId;
sites.AddRange(pSite);
}
_local.SaveChanges();
Reply
Answers (
3
)
how to get the data in lambda expwhere user id not in(1,2,3)
how to learn LINQ in easy steps