Click here to Skip to main content
15,881,882 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
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 
AnswerRe: Is .NET Remoting deprecated/obsolete? Pin
markrlondon2-Nov-20 17:44
markrlondon2-Nov-20 17:44 
QuestionAggregation count returns null in linq asp.net core Pin
ElenaRez27-Jul-20 7:59
ElenaRez27-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
Brian Prestwood20-Jul-20 19:50 
AnswerRe: How do I Add End User Self Registration to IdentityServer? Pin
Brian Prestwood8-Aug-20 7:17
Brian Prestwood8-Aug-20 7:17 
QuestionHow to join two linq queries to find some common data between them Pin
ElenaRez22-Jun-20 11:16
ElenaRez22-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);
            }

AnswerRe: How to join two linq queries to find some common data between them Pin
Eddy Vluggen22-Aug-20 10:15
professionalEddy Vluggen22-Aug-20 10:15 
QuestionHow to retrieve user's data from active directory by novell.Directory.LDap.NetStandard library Pin
ElenaRez22-Jun-20 0:05
ElenaRez22-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
sfd16-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
mvePete 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 
GeneralRe: SMTP authentication oddities Pin
DerekT-P8-Jun-20 0:59
professionalDerekT-P8-Jun-20 0:59 
GeneralLooking for a (free) .NET pluralizer / singularizer Pin
Sander Rossel3-Jun-20 1:11
professionalSander Rossel3-Jun-20 1:11 
GeneralRe: Looking for a (free) .NET pluralizer / singularizer Pin
Garth J Lancaster3-Jun-20 1:17
professionalGarth J Lancaster3-Jun-20 1:17 
GeneralRe: Looking for a (free) .NET pluralizer / singularizer Pin
Sander Rossel3-Jun-20 3:52
professionalSander Rossel3-Jun-20 3:52 
GeneralRe: Looking for a (free) .NET pluralizer / singularizer Pin
#realJSOP22-Jun-20 4:19
mve#realJSOP22-Jun-20 4:19 
JokeRe: Looking for a (free) .NET pluralizer / singularizer Pin
Richard Deeming3-Jun-20 1:34
mveRichard Deeming3-Jun-20 1:34 
GeneralRe: Looking for a (free) .NET pluralizer / singularizer Pin
Richard MacCutchan3-Jun-20 2:14
mveRichard MacCutchan3-Jun-20 2:14 

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.