Click here to Skip to main content
14,608,400 members

.NET (Core and Framework)

 
PinnedHOW TO ANSWER A QUESTION Pin
Chris Maunder16-Jul-09 3:09
cofounderChris Maunder16-Jul-09 3:09 
PinnedHow to get an answer to your question Pin
Chris Maunder16-Jul-09 3:05
cofounderChris Maunder16-Jul-09 3:05 
QuestionImplementation of Identity 4 in .net core 3.1 for SSO for multiple projects Pin
Ravikumar Patra14-Aug-20 2:41
professionalRavikumar Patra14-Aug-20 2:41 
AnswerRe: Implementation of Identity 4 in .net core 3.1 for SSO for multiple projects Pin
Dave Kreskowiak14-Aug-20 4:09
mveDave Kreskowiak14-Aug-20 4:09 
AnswerRe: Implementation of Identity 4 in .net core 3.1 for SSO for multiple projects Pin
Gerry Schmitz14-Aug-20 4:56
mveGerry Schmitz14-Aug-20 4:56 
QuestionDatabase for desktop application Pin
hiruthere12-Aug-20 23:34
Memberhiruthere12-Aug-20 23:34 
AnswerRe: Database for desktop application Pin
F-ES Sitecore13-Aug-20 1:40
mveF-ES Sitecore13-Aug-20 1:40 
AnswerRe: Database for desktop application Pin
Mycroft Holmes13-Aug-20 13:35
professionalMycroft Holmes13-Aug-20 13:35 
AnswerRe: Database for desktop application Pin
Gerry Schmitz13-Aug-20 16:13
mveGerry Schmitz13-Aug-20 16:13 
QuestionIs .NET Remoting deprecated/obsolete? Pin
honey the codewitch4-Aug-20 17:19
mvahoney the codewitch4-Aug-20 17:19 
AnswerRe: Is .NET Remoting deprecated/obsolete? Pin
Richard Deeming4-Aug-20 23:30
mveRichard Deeming4-Aug-20 23:30 
QuestionAggregation count returns null in linq asp.net core Pin
ElenaRez27-Jul-20 7:59
MemberElenaRez27-Jul-20 7:59 
AnswerRe: Aggregation count returns null in linq asp.net core Pin
Gerry Schmitz28-Jul-20 6:44
mveGerry Schmitz28-Jul-20 6:44 
QuestionHow do I Add End User Self Registration to IdentityServer? Pin
Brian Prestwood20-Jul-20 19:50
MemberBrian Prestwood20-Jul-20 19:50 
AnswerRe: How do I Add End User Self Registration to IdentityServer? Pin
Brian Prestwood8-Aug-20 7:17
MemberBrian Prestwood8-Aug-20 7:17 
QuestionHow to join two linq queries to find some common data between them Pin
ElenaRez22-Jun-20 11:16
MemberElenaRez22-Jun-20 11:16 
I have two linq queries like the following and their output results are correct:

var mytotal = _context.Apiapplicant.Where(c => !c.ApiRequestDate.Equals("") && c.IsDeleted.Equals(false)).GroupBy(o => new
            {
                Month = o.ApiRequestDate.Substring(5, 2),
                Year = o.ApiRequestDate.Substring(0, 4)
            }).Select(g => new
            {
                Month = g.Key.Month,
                Year = g.Key.Year,
                Total = g.Count()
            }).OrderByDescending(a => a.Year).ThenByDescending(a => a.Month).ToList();

The above query gives the total requests that was registerd in each month.

var numerator = from t1 in _context.Apiapplicant
                            join t2 in _context.ApiApplicantHistory on t1.Id equals t2.ApiApplicantId
                            join t3 in _context.EntityType on t2.LastReqStatus equals t3.Id
                            //join t4 in mytotal on new { t2.Date.Substring(0,4), t2.Date.Substring(2,5) } equals new { t4.Year, t4.Month }
                            // join t4 in mytotal on  t2.Date.Substring(2, 5) equals t4.Month

                            where t1.IsDeleted == false && t3.Name == "granted" && t2.Date != null && t1.ApiRequestNo != null

                            group t1
                            by new
                            {
                                lastReq = t2.LastReqStatus,
                                Year = t2.Date.Substring(0, 4),
                                Month = t2.Date.Substring(5, 2)
                            } into g

                            select new
                            {
                                Year = g.Key.Year,
                                Month = g.Key.Month,
                                lastReq = g.Key.lastReq,
                                GrantedCount = g.Count()
                            };


            var GrantedReqStatus = numerator.OrderByDescending(x => x.Year).ThenByDescending(a => a.Month).ToList();


The above query gives total requests for each month that has "granted" status. Now I want to find for all the requests that are registered in each month, how many of them has "granted" status. To obtain it, I've made a query like the following which should join both GrantedReqStatus and mytotal queries:

var LastGrantedStatus = (from t1 in mytotal
                                    from t2 in GrantedReqStatus
                                    where (t1.Month == t2.Month) && (t1.Year == t2.Year)
                                    group t1
                            by new
                            {
                                //  lastReq = t2.LastReqStatus,
                                Year = t1.Year,
                                Month = t1.Month
                            } into g
                                    select new {  Month=g.Key.Month, Year=g.Key.Year,grcount = g.Count()}).ToList();


But when I run the project, the following expressions doesn't print anything:


Console.WriteLine("LastGrantedStatus.Count:" + LastGrantedStatus.Count);
            foreach (var t in LastGrantedStatus)
            {
                Console.WriteLine("t.GrantedCount + t.Month:" + t.Month + "+" + t.grcount); //+ "+" + t. + "+" + t.Year);
            }

QuestionHow to retrieve user's data from active directory by novell.Directory.LDap.NetStandard library Pin
ElenaRez22-Jun-20 0:05
MemberElenaRez22-Jun-20 0:05 
AnswerRe: How to retrieve user's data from active directory by novell.Directory.LDap.NetStandard library Pin
Dave Kreskowiak22-Jun-20 3:45
mveDave Kreskowiak22-Jun-20 3:45 
QuestionGetting “Unable to connect to the remote server” When I call WebAPI Url (C#) Pin
sfd16-Jun-20 0:17
Membersfd16-Jun-20 0:17 
AnswerRe: Getting “Unable to connect to the remote server” When I call WebAPI Url (C#) Pin
Richard Deeming16-Jun-20 0:34
mveRichard Deeming16-Jun-20 0:34 
QuestionSecuring Net Core API Pin
pkfox12-Jun-20 4:04
professionalpkfox12-Jun-20 4:04 
AnswerRe: Securing Net Core API Pin
Pete O'Hanlon12-Jun-20 5:29
subeditorPete O'Hanlon12-Jun-20 5:29 
GeneralRe: Securing Net Core API Pin
pkfox12-Jun-20 8:15
professionalpkfox12-Jun-20 8:15 
QuestionSMTP authentication oddities Pin
DerekT-P7-Jun-20 11:21
professionalDerekT-P7-Jun-20 11:21 
AnswerRe: SMTP authentication oddities Pin
Richard Deeming8-Jun-20 0:00
mveRichard Deeming8-Jun-20 0:00 

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.