Click here to Skip to main content
15,889,116 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to uncompress zip file into a folder without external dependencies like Interop.Shell32.dll or 3rd-Party Assemblies? Pin
Richard Deeming12-Jul-18 2:43
mveRichard Deeming12-Jul-18 2:43 
GeneralRe: How to uncompress zip file into a folder without external dependencies like Interop.Shell32.dll or 3rd-Party Assemblies? Pin
Kerem Guemruekcue12-Jul-18 3:22
Kerem Guemruekcue12-Jul-18 3:22 
QuestionCommunicate With MEF Plugin From Another App Pin
Kevin Marois11-Jul-18 6:29
professionalKevin Marois11-Jul-18 6:29 
AnswerRe: Communicate With MEF Plugin From Another App Pin
Pete O'Hanlon11-Jul-18 7:19
mvePete O'Hanlon11-Jul-18 7:19 
GeneralRe: Communicate With MEF Plugin From Another App Pin
Kevin Marois11-Jul-18 7:40
professionalKevin Marois11-Jul-18 7:40 
GeneralRe: Communicate With MEF Plugin From Another App Pin
Nathan Minier12-Jul-18 1:10
professionalNathan Minier12-Jul-18 1:10 
GeneralRe: Communicate With MEF Plugin From Another App Pin
Pete O'Hanlon12-Jul-18 1:40
mvePete O'Hanlon12-Jul-18 1:40 
QuestionPredicateBuilder Usage Pin
Kevin Marois10-Jul-18 17:45
professionalKevin Marois10-Jul-18 17:45 
I've never used PredicateBuilder before. If anyone has used it, I could use some help
List<PurchasingEntity> results = null;

IQueryable<PurchasingEntity> query = (from c in db.Companies
                                        join p in db.Projects on c.Id equals p.CompanyId
                                        join j in db.Jobs on p.Id equals j.ProjectId
                                        select new PurchasingEntity
                                        {
                                            CompanyId = c.Id,
                                            ProjectId = p.Id,
                                            JobId = j.Id,
                                            Phase = j.Phase,
                                            Quantity = j.Quantity.HasValue ? j.Quantity.Value : 0,
                                            StartDate = j.StartDate.HasValue ? j.StartDate : null
                                        });

var predicate = PredicateBuilder.True<Purchasing>();

if (companyId > 0)
{
    predicate = predicate.And(i => i.CompanyId == companyId);
}

if (projectId    > 0)
{
    predicate = predicate.And(i => i.ProjectId == projectId);
}

if (startDate != null)
{
    predicate = predicate.And(i => i.StartDate >= startDate);
}

if (endDate != null)
{
    predicate = predicate.And(i => i.StartDate <= endDate);
}

results = query.Where(predicate); // <===== ERROR HERE
return results.ToList();

The compilation error is
cannot convert from 'System.Linq.Expressions.Expression<System.Func<Jayhawk.DAL.DataContext.Purchasing, bool>>' to 'System.Linq.Expressions.Expression<System.Func<Jayhawk.Entities.PurchasingEntity, int, bool>>'

Not quitre sure what's wrong here? Can anyone help?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: PredicateBuilder Usage Pin
Gerry Schmitz10-Jul-18 20:51
mveGerry Schmitz10-Jul-18 20:51 
GeneralRe: PredicateBuilder Usage Pin
Kevin Marois11-Jul-18 5:15
professionalKevin Marois11-Jul-18 5:15 
AnswerRe: PredicateBuilder Usage Pin
Mycroft Holmes10-Jul-18 22:48
professionalMycroft Holmes10-Jul-18 22:48 
GeneralRe: PredicateBuilder Usage Pin
Kevin Marois11-Jul-18 5:14
professionalKevin Marois11-Jul-18 5:14 
AnswerRe: PredicateBuilder Usage Pin
Keviniano Gayo11-Jul-18 1:38
Keviniano Gayo11-Jul-18 1:38 
QuestionHow to Sorting the No in C# Pin
Member 173685110-Jul-18 4:40
Member 173685110-Jul-18 4:40 
AnswerRe: How to Sorting the No in C# Pin
Pete O'Hanlon10-Jul-18 5:20
mvePete O'Hanlon10-Jul-18 5:20 
AnswerRe: How to Sorting the No in C# Pin
Gerry Schmitz10-Jul-18 9:51
mveGerry Schmitz10-Jul-18 9:51 
Questioni have problem to create diffie hellman Pin
Member 138380639-Jul-18 16:44
Member 138380639-Jul-18 16:44 
AnswerRe: i have problem to create diffie hellman Pin
OriginalGriff9-Jul-18 19:16
mveOriginalGriff9-Jul-18 19:16 
AnswerRe: i have problem to create diffie hellman Pin
Eddy Vluggen10-Jul-18 1:26
professionalEddy Vluggen10-Jul-18 1:26 
QuestionAsking Credential on every time in C# windows application that contains Crystal Report Pin
Member 139029998-Jul-18 16:21
Member 139029998-Jul-18 16:21 
AnswerRe: Asking Credential on every time in C# windows application that contains Crystal Report Pin
User 41802549-Jul-18 0:05
User 41802549-Jul-18 0:05 
AnswerRe: Asking Credential on every time in C# windows application that contains Crystal Report Pin
Eddy Vluggen10-Jul-18 1:25
professionalEddy Vluggen10-Jul-18 1:25 
QuestionHow to change Tab Page size Pin
User 136751148-Jul-18 5:14
User 136751148-Jul-18 5:14 
AnswerRe: How to change Tab Page size Pin
OriginalGriff8-Jul-18 6:08
mveOriginalGriff8-Jul-18 6:08 
AnswerRe: How to change Tab Page size Pin
Gerry Schmitz8-Jul-18 23:06
mveGerry Schmitz8-Jul-18 23:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.