« first day (2558 days earlier)      last day (2389 days later) » 
01:00 - 12:0012:00 - 23:00

12:08 PM
well. My days is usually spent staring a monitor without knowing what am I doing...
 
My days are spent processing visual information from my eyes not knowing what I'm doing.
 
My days are spent eating chicken
 
Hey all. How can I put something in 1 (vertical) line in C#?

Example:

MyFirstTestString \t\t SomeDifferentThing
Other \t\t ThisOneShouldBeMoreToTheRight
 
you need to determine the length of "\t"
then you can check how many tabs the text (on the left) has
 
But is there a way I can specify an amount of fixed characters or so?
 
12:13 PM
then you append the text with x times the tab character
 
Joker asks Batmen for his mask.
Joker: Hey can i wear your mask, batman?
Batman: sure. *hands joker his mask*
*Joker wears it.*
Batman: how do you feel, joker?
joker: I miss my parents.
^ that's from a meme
 
130
Q: .NET Format a string with fixed spaces

user72491Does the .NET String.Format method allow placement of a string at a fixed position within a fixed length string. " String Goes Here" " String Goes Here " "String Goes Here " How is this done using .NET? Edit - I have tried Format/PadLeft/PadRight to death. They ...

@ErwinOkken Also, where are you displaying this text? Remember that if you're not using a fixed-width font, it won't align perfectly.
 
@AvnerShahar-Kashtan Thanks. It's in a console application.
 
And if it's for a console app, you can use a library to have nicely formatted tables, like this one:
 
 Console.Write(string.Format("{0,-27}", opponent) + string.Format("{0,-27}", venue) + string.Format("{0,-27}", datetimestr));
 Console.WriteLine();
@AvnerShahar-Kashtan That's all I was looking for :) thanks
 
12:36 PM
Why do I get a "Possible NullReferenceException" here?
					if (reader.Name.Equals("EmbeddedResource", StringComparison.CurrentCultureIgnoreCase) &&
						reader.GetAttribute("Include") != null &&
						reader.GetAttribute("Include").EndsWith(".resx"))
.Endswith can't throw, since I null check before I even get there.
 
It probably doesn't know .GetAttribute(whatever) will return the same value in both calls
 
^
It doesn't know that reader.GetAttribute is idempotent. :)
As far as the static analyzer is concerned, the two calls will return different values. It might be true as far as the runtime as well - a different thread might remove it from the reader, theoretically.
 
reader.GetAttribute("Include")?.EndsWith(".resx") == true
 
Unless, of course, some of your team are still using VS2013. :)
 
@milleniumbug That won't work, as I'd be going if(bool && bool?)
 
12:41 PM
hence the == true comparison
 
ohhhh
nice
 
(bool?) ?? false
 
that's another option
 
I think "== true" looks better here
 
feel free to use the one you prefer
 
12:43 PM
bool instead of bool? :D
 
type bool = enum { true, false, FileNotFound };
 
type bool = enum { true, };
 
@Wietlol Positive Thinking.
 
Anyone from Cyprus or Greece?
 
data Bool = False | True
 
12:53 PM
true False = Data | Bool
 
| true Data = Bool False
 
bool = !bool
 
!bool = bool!
 
motherofgod
 
at last I got R#
 
1:07 PM
Julia Silge on October 17, 2017

If you hang out on Meta Stack Overflow, you may have noticed news from time to time about A/B tests of various features here at Stack Overflow. We use A/B testing to compare a new version to a baseline for a design, a machine learning model, or practically any feature of what we do here at Stack Overflow; these tests are part of our decision-making process. Which version of a button, predictive model, or ad is better? We don’t have to guess blindly, but instead we can use tests as part of our decision-making toolkit. …

 
1:24 PM
hello, I am a newbie in C#, But I have a question, I am using METADATA for validations, and in my view - database I have a dropdown list, in one table of my DB I have the values of country, and in another table (Person) I have countryID,
I put the metadata Display(Name = "Country") in the table Person in the countryID element, and works ok, My question is: I have to use the countryID in other tables, I have to put in all the tables where is shows the country ID the metadata?? or if just put the metadata in the countryID of the table country?? I tried this but doesn´t work, is this possible??
please help!!!
 
@Mary I'm a bit lost; some specifics please.
You're using metadata: Which c# class/library/Api is that?
You have a database: It's clear you have (at least) 2 tables. Do you just get the data into a DataSet? How does it get to c#?
Also, if I understood the question right, this seems like a DB architecture question, not a c# one; but we'll help anyway if we can:
Is this a question of "Should I put foreign keys (countryID) in all tables?"
 
By "metadata", you mean attributes, right?
Three hours later, the server finished installing its 27 scheduled Windows update. Result? It seems I won't have to rewrite the *@$%&#$@ .NET HttpClient stack after all.
 
How can I build a SyntaxTree from a .cs file? I'm using Microsoft.CodeAnalysis. I'm trying to do .Create(fileContent, ...) but Intellisense shows me strange stuff, and visual studio also says SyntaxTree doesn't actually have a method called Create, when intellisense suggests it to me on putting a '.' on the SyntaxTree.
 
windows update solves programming problems
 
@AvnerShahar-Kashtan Totally worth burning a few hours on SO chat.
 
1:38 PM
@Metallkiller I actually managed to get other tasks done. A little bit. Maybe.
 
@Metallkiller using System.ComponentModel.DataAnnotations; this is what I put in my class. METADATA is a class inside the MODELS folder, I see this in a tutorial, this is for not write directly in the model class, in case I have to change the model I do not lose this annotations
 
@Mary Can you give me the fully qualified classname of metadata please?
Maybe others already know whats up, like avner, but I'm still confused
Like...is it System.ComponentModel.DataAnnotations.METADATA?
Or MarysProject.MODELS.METADATA?
 
I am using html, the data is inside divs <div class="form-group">
@Html.LabelFor(model => model.id_marca, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10">
@Html.DropDownList("id_marca", null, htmlAttributes: new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.id_marca, "", new { @class = "text-danger" })
 
ctrl+k = format post btw
 
@Metallkiller that is my view
 
1:45 PM
So you're making an asp.net project?
@Mary Watch:
 
@Metallkiller yes
 
If I wanna share code, I past code into the chat:
public string Read(string filename)
{
    string FileContent;
    using (StreamReader Reader = new StreamReader(filename, Encoding.UTF8))
    {
        FileContent = Reader.ReadToEnd();
    }
    if (FileContent.Contains("\ufffd"))
    {
        using (StreamReader Reader = new StreamReader(filename, Encoding.Default))
        {
            FileContent = Reader.ReadToEnd();
        }
    }
    return FileContent;
}
 
pls format
 
That is hard to read.
 
1:48 PM
i do that, but doesnt show like that
 
Now I paste it again, and before I send, I press ctrl+k
 
sorry
 
damnit admins
public string Read(string filename)
{
    string FileContent;
    using (StreamReader Reader = new StreamReader(filename, Encoding.UTF8))
    {
        FileContent = Reader.ReadToEnd();
    }
    if (FileContent.Contains("\ufffd"))
    {
        using (StreamReader Reader = new StreamReader(filename, Encoding.Default))
        {
            FileContent = Reader.ReadToEnd();
        }
    }
    return FileContent;
}
can you please leave my shitty code paste?
 
paste, CTRL+K, enter
 
<div class="form-group">
@Html.LabelFor(model => model.id_municipio, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DropDownList("id_municipio", null, htmlAttributes: new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.id_municipio, "", new { @class = "text-danger" })
</div>
</div>
 
1:49 PM
Hi guys
 
I have following milliseconds store in my table:
38283,106678,10
Now i can show 10 ms thats fine
 
what do the commas mean?
are those 3 values?
 
They are individual records store in my table
 
1:51 PM
But showing 38283ms would look a bit awkward
 
@Metallkiller the metadata is the name of the class, like Student, or another name
 
go ms (milliseconds), s (seconds), ks (kiloseconds), and Ms (Megaseconds)
 
You can use a library like Humanizer, or roll your own.
 
hail SI units
 
TimeSpan.FromMilliseconds(1299630020).Humanize() => "2 weeks"
TimeSpan.FromMilliseconds(1299630020).Humanize(3) => "2 weeks, 1 day, 1 hour"
TimeSpan.FromMilliseconds(1299630020).Humanize(4) => "2 weeks, 1 day, 1 hour, 30 seconds"
TimeSpan.FromMilliseconds(1299630020).Humanize(5) => "2 weeks, 1 day, 1 hour, 30 seconds, 20 milliseconds"
 
1:52 PM
So i am looking for some way which will convert equivalent ms,second,minute
 
@Metallkiller yes, i am making an asp.net , mvc 5, Entity Framework 6
 
I am unable to get this method :
Humanize()
 
Is there a way to wait for 5 minutes without holding thread at it?
For web service
 
Avner pretty much said it. Either use a library, or write a small method that converts those ms to a readable string. take last 3 digits, put into ms. Devide by 1000, mod by 60, put into seconds. devide by 60, put into hours.
 
@Learning It's an extension method in the Humanizer library I linked to above.
 
1:54 PM
I know, that there is 'await Task.Delay()', but this hold thread for that time
 
It's a great library for prettying up values.
@Taurib No, it doesn't.
 
hey guys, I created multiple contexts (DbContext) for my application. some context requires an entity that is in another context. this makes code first migration to [re]create that database. how do I solve this?
 
jk ilu
 
But I suspect what you're looking for is a Timer - set its interval to 5 minutes and wait for it to fire.
 
@Taurib Store DateTime.Now, poll sometimes for DateTime.Now-startTime >=5mins
 
1:55 PM
@AvnerShahar-Kashtan Thanks for the suggestion but are you sure for this task i need to use this library?
 
Or use a Timer. Yeah use a Timer.
@Learning Youcan build your own method, like I described.
 
@Learning As @Metallkiller says, it's pretty easy to roll your own. Humanizer is a good all-around library, though.
Though with a tested lib, you're more likely to avoid edge-cases.
And you can set the required precision. For instance, your second value - 106678 - can be shown as "1 minute", "1 minute, 46 seconds" or "1 minute, 46 seconds, 678 milliseconds", with a single parameter change.
 
hello, people, please help!!!
 
Is something on fire?
Do you need medical assistance?
I don't have enough information to provide adequate assitance!
J.Doe has 93 days left on his suspension
I wonder what his first words will be
 
@Kieran And when he returns, border-radius will still be there.
 
2:01 PM
hahaha
Too right
 
Reminder: In the event of fire, flood or famine, please contact emergency services, not the C# chat room. We are unequipped, unprepared and in many cases just plain can't be bothered to assist.
9
 
i dont feel like discovering what his first words will be
 
pinned
 
Hmm, interesting, with that 'Task.Delay()' one of the "higher level" programmers told, that this is bad practice to hold thread with it
 
@Taurib Thread.Sleep will hold up the thread.
 
2:02 PM
lets make a script that adds 1 day to his suspension whenever his suspension drops below 1.0 days
 
Calling Wait() on Task.Delay() will hold up the thread.
 
We can't add more days :(
 
@AvnerShahar-Kashtan Yee, I know
 
But Task.Delay itself? It's simply a task that completes after the specified time. No actual threading work involved.
 
So if I would do something like that, this should be alright?
                    if (retry <= 3)
                    {
                        await Task.Delay(tryDelay);
                        await SendToService(xmlDoc, retry + 1);
                    }
 
2:03 PM
Yeah, I'd use it for a retry mechanism.
 
anyone does some serious logging on production servers?
 
Wait, you're calling yourself recusively?
 
@Wietlol what else would be the point of logging?
 
i wonder how large the logging is
 
@mikeTheLiar Turning trees into usable wood.
 
2:04 PM
in bytes
per day
 
@AvnerShahar-Kashtan Well, I call that method for 4 times at this point yes
 
@AvnerShahar-Kashtan I'm a lumberjack and I'm okay
@Wietlol depends on the day
Depends on how much use the system is getting
 
Well, I'm off home now, anyway. Have fun, y'all.
 
Depends on how much the users have managed to fuck everything up.
 
@mikeTheLiar average of monday to friday
 
2:05 PM
(spoilers, they've managed to seriously fuck everything up)
Honestly I have no idea. Ballpark somewhere between a kb and a mb.
 
hmm...
i suppose we need to cut down logging a bit then
we are building a forest per day
on the development server :D
 
Meh
HD space is cheap
Unless you're logging noise
 
this is assuming that full logging is on
which has a log call in every business logic method
the issue is the stacktrace
the stack trace from the entry point of our code to the end is what you want
but our framework is built so that it also gives us 90 more frames
 
Logs are generally not very large. :/
 
Hello!
 
2:16 PM
per log, we have a 17kb stack trace noise
(not minimized logs though, but that would reduce it by about 30-40%)
 
Perhaps you should cut down on the errors, thus the logs, thus the file size.
 
if that stack trace noise is gone, it reduces the logs by about 50%
i dont really just want to log errors
i also want to log the input and output of the service web requests
 
Then deal with the file size :-3
How large is it, really? And for what time do you keep logs?
We generally rotate them away after a month.
 
I have SQLite table with auto increment column called Id, I want to insert row with Id value, what will happen?
 
todays log is at 4MB
minimized, that be 2MB
 
2:21 PM
So that's tiny, what's the big deal?
 
and without the noise, it'd be 1MB
this is not the production server
this is the development server
the product isnt used on production yet
this is just me using it
 
Worry about it later then.
Just plug in large enough disks and see what happens.
 
I'm off. @Mary I hope someone else can help you, I don't really know anything about asp.net. Bye all!
 
can someone help me?
 
hey guys, what are the implications of sepparating your entities into multiple DbContexts?
@Mr.Noob it will probably throw an exception. have you first tried doing what you described?
 
2:26 PM
it will take a lot of time to make test example
 
that should be no more than 5 mins
 
I thought everyone except me already know this...
I wanted to test it inside my app and there it will take longer
ok I will try to create something similar to what I have in empty db
 
just create a new db with a single table with 2 columns and there you go. you'll have a much more accurate and debugable answer
 
yes I am working on it now
 
@AvnerShahar-Kashtan Ok now i am using humanize library
 
2:34 PM
8
Q: Is there a set identity_insert on equivalent for SQLite?

Omar JackmanIn TSQL there is SET IDENTITY_INSERT ON; is there a functional equivalent in SQLite?

 
But i want milliseconds as ms
Is there a way to do this with that library?
 
hmm, so it allows me to insert value into auto increment as long as its bigger than the auto increment number, and then it will skip to next value, for example 4,5,6,10 -> 11
but I cant enter lower number.
 
2:56 PM
@Learning its almost as if you can google that
 
I already googled
but couldnt find it that is why asking
and i dont see much questions also on that project
 
humanize library?
 
how many feet are in 7 minutes?
 
@hilli_micha I'm gonna assume c, right?
@Learning isn't that a JS library? If you want time in ms, why not just get your time as int in ms, then append " ms"?
 
@Kieran I do not know how to explain more this, nobody know about metadata, this is what I use for guide me docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/…
 
3:01 PM
That is not a js library
 
hi, someone knows about ASP.NET mvc5 ??'
 
user6501892
General question here, I have a listview that can click and drag to adjust order. The list has a ranking that starts at 1-...n, but when I adjust the ranking by moving items up or down the observable collection, I want to refresh the rankings. So, when you move stuff around and your ranking is something like 4, 2, 5, 1, 3..I want the rankings to refresh to do 1-5
 
@hilli_micha 42609
 
I need to know about the dataannotations
 
@KendallFrey That was just me memeing, damn dude, way to show me up.
 
3:04 PM
!!convert feet to minutes
 
@mikeTheLiar Cannot convert <foot> to <minute>.
 
!!convert 1 km to mmHg
 
@mikeTheLiar Cannot convert (<kilo>*<meter>) to <mmHg>.
 
!!convert @Failsafe to someone who's not completely useless
 
@mikeTheLiar Unit @Failsafe not recognized.
 
3:06 PM
!!sudo convert @mikeTheLiar to obsidian
 
@KendallFrey Okay.
 
bye bye
 
user7480455
Hi All
 
heyho
!!tell mikeTheLiar haha
 
3:20 PM
i like that one
!!haha
 
^rofl literally
 
heart broken developer :(
 
Developers don't have hearts, silly.
 
huhuhu
I feel pain somehow. Maybe I have an heart
 
3:35 PM
I think your feelsService is due for an update
 
:_(
I hope we don't feel pain. But I guess it's like a robot
:(
 
Cap is a robot
!!do you feel pain
 
@mikeTheLiar Doubtfully
 
!!do you feel joy
 
@mikeTheLiar Certainly
 
3:38 PM
.....this makes me happy in a way that I can't quite articulate
 
:(
not only in visual studio has a break point,
but in real life :(
but can we just use "Continue" or step next?
I mean, in love life, we experience and need to put some break points in order to fix something or see something?
:( well, love life or even life is like a programming. :(
But I choose programming of course
Ehh sorry, I talk too much
 
@mark333...333...333 ngl, you have a point
 
Thank you @Kieran sir :(
 
user7480455
Why do you guys have a robot mike?
 
eh?
 
user7480455
3:48 PM
I have it set on ignore but I don't understand why it exist
 
Harmless fun and she's useful for automating things we have to tell people with great frequency
Like !!format
 
Thank you guys, something it's good to have people just listening just to release what's inside
 
user7480455
ahhh I see
 
user7480455
When I first started here I know it would post lewd images so I had to ignore it
 
user7480455
but I thought it was a human at first
 
3:54 PM
when has cap ever posted lewd images
christ
 
Well her giphy command is just a rightGif proxy
!!giphy vordt
 
user7480455
im not sure I guess back in April
 
user7480455
but it does not matter that how I learned about the ignore option
 
user7480455
so it can do what it is required to do
 
4:35 PM
@Kieran this is what it feels like to be still in the office after 6pm
this is what it feels like to be you
:O
 
4:59 PM
lmao
im going now anyway
laters
 
user7480455
5:14 PM
bye
 
5:37 PM
is it possible to have the same entity in different multiple DbContexts?
I have an entity A, that is in the context 1, and an entity B, that is in the context 2. Entity B depends on entity A, therefore code first migration wants to create a table for entity A (as well as the other tables for the entities in the context 2) when it already exists. how do I solve this?
 
Need to pick a home for it
you can't have DbSet<MyTable> in separate contexts
 
in multiple contexts, you mean?
 
yes
 
ok. actually, I have a single DbSet<A> in one context
The problem, it seems, is that entity B (context 2) has a navigation property to A (contet 1), which is in another context
 
It has the navigation?
 
5:49 PM
yes
That "Entity A" is the User entity (users table). didnt mention it before because I thought it wouldnt matter
 
6:08 PM
Think because of the navigation it will always map there
 
shouldnt it recognize that it has already been mapped in context 1 so a new table wont be needed?
anyone??
 
6:33 PM
looking for a suggestion. The situation is this, I have a method that will get called from multiple threads. This method adds an object to a collection. The object has a "current" flag on it. When the object is added, it "current" flag is set to true while all other object's "current" flag is set to false. The problem is, because of race conditions, I could end up with two objects marked as "current".
One way might be to update the connection based on a short timer (like 10ms) but I feel like there should be a more elegant way.
 
@BrandenBoucher I feel like there is a data structure for this. Concurrent Queue? Concurrent stack? Hold on.
 
Guys I need some help with sql
Is there a way to do something like this in sql
DECLARE @IsASpecialCase BIT;

SELECT
CASE WHEN @IsASpecialCase THEN
BEGIN
UserKey,
UserName,
UserAddress
END
ELSE
BEGIN
UserKey
END
FROM Users WHERE UserKey = 1
 
Either that or you could just lock on your collection
Minor performance hit, good thread safety.
But reading your question, it seems like your using the flag. Could you do a concurrent stack and just implicitly assume the top object is your "current" object?
 
@Sidney are you talking about my question?
 
No, sorry, the one before yours. Brandon's
 
6:39 PM
ah ok
 
Sql voodoo is not my forte unfortunately.
 
@Sidney, I am doing something similar to that now with a concurrentqueue but I end up with something other than the last object be the "current"
Let me look into the lock. Thanks
 
Locking is your best bet I would think, at least without knowing your implimentation.
 
user7480455
Hi guys... EF question if I may
 
user7480455
is there a way to see what database the edmx file is attached to?
 
6:59 PM
posted on October 17, 2017 by Scott Hanselman

As you likely know, I have a BUNCH of robots in the house. Whether it be turning a tin can into a robot, driving a Raspberry Pi around with Windows IoT, building robot arms with my kids, or controlling a robot with Xamarin code, I'm ALL IN when it comes to home robots. I also have Alexa, Cortana, Siri...but they have no bodies. They are just disembodied voices - why not a social robot with a b

 
user7480455
Found it... there was not web config in the console application found the db connection in app configuration
 
7:19 PM
Hey guys. Does anybody know if WPF sets the focus to a new element before invoking LostFocus events? I get null when using the FocusManager to find the focused element.
Nevermind I'll post that in the WPF thread instead.
 
7:34 PM
@person27 Presumably that's the reason it's called LostFocus and not LosingFocus
 
There was an SO answer that led me to believe it was possible.
 
so I created a second app, added the entities and their mapings (fluent API) and everything worked as expected. now, i'm migrating it to the bigger app and Entity Frameowork is complaining about cycles. WTF?
 
Cycles?
 
"may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or..." bla bla bla
I CTRL+C, CTRL+V'ed all the entities and their configurations
 
ahh on the FK
what if you look at the table in SQL check the FK
 
7:41 PM
ran add-migration and update-database multiple times on the test app with no errors
 
it would only run once if nothing changed
 
the Fk does exist @juanvan
just saying the test app has never complained about anything
 
There are No FK on any tables
 
how do you know? I'm telling there is
 
@KendallFrey which one is LosingWillToLive?
 
7:45 PM
Ya there is, and EF is having a problem because of the FK mapping in creating a migration
 
@juanvan the problem is why the test's EF didnt complain about such thing?
I can delete the whole db and recreate it, insert stuff and everything is ok. this doesnt happen in the production app
and theres nothing different with the entities and their config/maps
 
and they are both code first
 
yes
"Introducing FOREIGN KEY constraint 'FK_dbo.TB_FORMULARIO_PERGUNTA_dbo.TB_FORMULARIO_PERGUNTA_ID_PERGUNTA' on table 'TB_FORMULARIO_PERGUNTA' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
Could not create constraint. See previous errors."
Both entities/maps related to the TB_FORMULARIO_PERGUNTA and TB_FORMULARIO_PERGUNTA tables are the same. 100% the same.
the add-migration creates the same Up() method for both appps, however one complains about cycles while the other doesnt
 
There anything in the modelBuilder that is set on one and not the other?
 
user7480455
8:05 PM
Juanvan why do developers seem to like code first so much?
 
user7480455
I tell my programmers database first only
 
Because a lot of them don't really understand databases but they understand code
 
user7480455
but reading up on it it seems like microsoft people only talk of code first.. it seems so back wards
 
user7480455
oh
 
user7480455
ok
 
user7480455
8:06 PM
to me a strong foundation is essential (meaning database)
 
Some people don't want to be bothered with the DBA Stuff and rather create them in code. I like DB First, but I am a monster
 
I can understand the impetus for code first.
If were writing an app to write to csv files I almost certainly wouldn't create a file template.
 
ya but a DB is not a flat file
 
Yeah, but If I wrote a well defined data contract, It could be converted to a DB pretty easily, instead of trying to adapt an existing DB to the data contract.
 
user7442629
8:22 PM
Hi guys
 
user7442629
Any way to use the same RegEx group name as in a previous group? (in an OR statement - it will either match one or the other, but both sets should have a group of the same name, so that I can just access it)
 
regex is not really an OR
oh you can do RegEx() || RegEx()
 
user7442629
You can have an OR in RegEx
 
user7442629
So it either matches one expression or the other
 
user7442629
But both expressions should have the samme group
 
user7442629
8:25 PM
And I want the same name
 
user7480455
bye bye all!
 
@RoelvanUden Dammit Roel. Y u do dis?
 
Android is garbage anyway so there
 
@Aleksbgbg You could just give both groups the same name, but why not put the OR within the group?
 
@milleniumbug Android could beat up {milleniumbug.Phone.OSFamily}
 
user7442629
8:30 PM
@KendallFrey it's a different match (i.e. the group is not in the same place)
 
I'm using an android phone unfortunately
 
user7442629
Don't worry about it, too hard to explain xD
 
9:00 PM
question, if I do this in my model, I still get null reference, when I'm starting to loop through that in my Razor view. Any idea why?

public List<UserRoleInt> Roles { get; set; } = new List<UserRoleInt>();
@foreach (var item in Model.Roles)
{
<dd>
@item.Role.Name
</dd>
}
 
@Taurib I would assume you either have a null reference in your list of Roles, or one of your items has a Null Role.
If the item is null, it obviously can't have a role. Similarly if a role is null, it doesn't have a name.
 
Well yes
but the thing is, I initialize this list in my model already
so it should be just an empty list
 
Can anyone help me with this question:
0
Q: Change the Url generated by PagedList.Core.Mvc and replace the query string [ASP.NET Application]

Umar AftabI am using PagedList in a fully functional pager and it is generating the query string for the indexed pages as expected.[The pages and the pager are being displayed correctly.] I am looking for a way to customize the URL that is generated via the IPagedList with the custom one as shown below. ...

 
wait, you might me right here
there is an logic error
Roles = user?.Roles.ToList()
 
Are you in a good situation where you can just step through it in the debugger?
 
9:08 PM
could say so
but I think I got the error figured out
 
👍
 
Yes, thanks for thinking with me! :)
 
10:03 PM
hello
is anyone familiar with SSO (Single Sign Out)
 
01:00 - 12:0012:00 - 23:00

« first day (2558 days earlier)      last day (2389 days later) »