« first day (2187 days earlier)      last day (2744 days later) » 
01:00 - 18:0018:00 - 21:00

1:58 AM
might be a silly question, but if I have a struct that has some fields, do I want to use properties, or just keep those as fields?
when I'm 100% sure I won't ever need/want a custom getter/setter
I mean I'm reading everywhere that the JIT is inlining them
but is that guaranteed?
for auto properties that is
 
 
4 hours later…
6:21 AM
@JakobMillah sorry to say but is so ma nizzle
 
7:13 AM
morn all
 
good morning
 
 
1 hour later…
8:21 AM
Hello mates. Question about Validation. ATM i am using reflection for validating all entities which derive from ValidationBase, i know another way of validating entities like creating custom Validators for each entities, but it results in more code. What will you advice use reflection or write custom validators, will i gain high value in performance if Project is eCommerce (Sales Ordering context)
Sales per day 100-1000, not including Holidays like New Year, Halloween etc
I am speaking about domain model validation
in application service layer
 
are DataAnnotations not sufficient?
with custom validation attributes etc
no need to use reflection (bleurgh)
 
8:38 AM
i ll link
    public class StockItem : AggregateRootBase<int>
    {
        public StockItem(int id, StockItemGeneralDetails stockItemGeneralDetails, StockItemPackagingDetails stockItemPackagingDetails, List<StockItemCost> stockItemCostHistory, List<StockItemPrice> stockItemPriceHistory) : base(id)
        {
            AddValidationRule(new ValidateID<int>($"{nameof(ID)}", true));
            AddValidationRule(new ValidateRequired($"{nameof(StockItemGeneralDetails)}"));
            AddValidationRule(new ValidateRequired($"{nameof(StockItemPackagingDetails)}"));
Haven't used DataAnnotations on Domain Model
Using them only on ViewModels and ReadModels
 
I have a session active somewhere on our network that is causing my account to lock repeatedly. The network guys insist there is no way of telling where
I don't believe them
(Active Directory)
 
@TomW Are you using Lync?
 
Skype for Business
So basically yes
 
Have you changed password recently?
 
Yes
 
8:47 AM
Sign out, delete saved Credentials, sign in with new ones
 
What do you mean by 'saved credentials'?
 
Lync is saving entered credentials, when you change AD password, it tries to re-auth with old credentials, but it allows you to use lync as usual
 
What does it mean to delete them?
Delete what, where?
 
When you Sign out from lync
there is link
Delete my sign-in info
 
Oh yeah I see it now
It appears to do absolutely nothing, you can just click sign in again
 
8:50 AM
That lync is strange, when you change AD password, it signs in you but than begins to auth password, and it makes your account to lock
 
Blatantly a workaround for a bug
 
sec
gonna do it
 
War
Guys ... unit tests ... I built a workflow engine because I have a bunch business processes that are quite similar ... is it worth building a unit test for each process?
Or should I just test the steps individually
A workflow is basically just a blob of data that my execution context works through
 
@TomW When you sign in again, did it ask for password?
@War if one of processes changes in future, how you gonna test it?
i prefer to waste time and have tests
 
War
@QuietNaN change the unit test / create a new one for the second version of the process
I think my concern was the size of the test
defining and testing a whole business process ... something screams "this is not unit testing" at me for some reason
but I can't quite put a finger on why
 
8:58 AM
To say the truth, i don't know, each process for me is unique and i write tests for them, but if its Huge process like (Place Order => Reserve Stock => Bill Customer => Accept Order)
i have tests for each step
and also test for whole process
if i make change on Bill Customer side
i just test that step
and i try to use GWT pattern
Given_ShoppingCartExists_When_PlacingOrder_Then_ShouldCreateNewOrderWithStatusPr‌​ocessing
@War BTW how are you validating your domain models, i have dilemma, Use reflections and have 1 validator or Custom Validators for each entity
 
@QuietNaN no
 
War
hmmm ... i'm already unit testing each step ... this is what makes me think that testing a whole workflow is basically an integration test not a unit test
Validation of domain models ? ... do you mean the model or the entities within?
To validate an entitiy for the most part i simply use the dataannotations framework ... it's pretty dam powerful
 
@TomW I guess it's its a bug, try deletion of sign in info, then close Lync, open it again and sign in, it should ask for password
 
War
19
Q: How can I use the Data Validation Attributes in C# in a non-ASP.net context?

Chris McCallI'd like to use the data validation attributes in a library assembly, so that any consumer of the data can validate it without using a ModelBinder (in a console application, for instance). How can I do it?

 
@War yes i am using DA but only on ViewModel, ReadModel(EF), side but on Domain Models i have Generic ValidationBase
In constructor:
            AddValidationRule(new ValidateID<int>($"{nameof(ID)}", true));
            AddValidationRule(new ValidateRequired($"{nameof(StockItemGeneralDetails)}"));
            AddValidationRule(new ValidateRequired($"{nameof(StockItemPackagingDetails)}"));
 
War
9:06 AM
I literally just use annotations
anything that can't be put in a data annotation imo is not a validation it's a business rule
for example ... checking if an invoice is related to a company is not validation but checking that the invoice number is not null is
no need to write lines of code for validation when such criteria is basically part of the objects deifnition
 
So in domain model, you only validate Business rules, like To Place Order, OrdeLines should be > 0
 
War
I would have an annotation for that yes
anything more complex like "can the current user place that order" is a business rule
validation != business rule
I draw a nice clean line before them
 
how You call, when You validate if business rules are met?
 
War
as a general rule validation should be possible by simply looking at the object
@ntohl that's part of my business logic
if i have common rules / inherited rules I can share such logic
my service layer handles all that quite nicely
typically ... most of my business logic methods are <20 lines of code but I separate a lot and inherit a lot
for example
An invoice is a type of transaction
all the rules that apply to a transaction apply to an invoice
so I don't need lots of rules in the invoice service
I can reuse the ones form the transaction service
see what I mean?
In my workflow system I basically implement 1 business rule per step ... if the rules are complex then I have a lot of steps ... it's not so bad ... it adds visibility in to the process
 
9:29 AM
I see
 
If i have custom validators like OrderPersistenceValidator , they live together with model right?
 
War
@QuietNaN How reusable are they? if they could apply to many things I would put them in a shared assembly that you can refer to in many places
What would an OrderPersistenceValidator actually do?
 
@War Well if i have ID validation yes it will be Common, but if i have ShoppingCartItems validation it will live with its model
OrderPersistenceValidator validates order properties before Persistence
 
War
Also I tend not to think about things in terms of "validators" ... the validator (of which there is only one) is the thing evaluating the object model (IMO but it's a terminology thing) ... I tend to put "Attributes" on my model properties that the Validator evaluates
@QuietNaN that sounds like it's doing too much ... it could probably be several attributes
Again ... may not always apply but the general rule of thumb I go by is that an attribute should do one chek ... is thing null, is thing meeting a regular expression, is thing a collection with at least one item
if you do more than one check you probably want more than 1 attribute
it seems at first wasteful but when you look back at your models you'll see all those attributes and immediately know what makes that model valid
 
 
3 hours later…
12:10 PM
@War I was taking about this type of validation style.
47
Q: Validation in a Domain Driven Design

Todd SmithHow do you deal with validation on complex aggregates in a domain driven design? Do you consolidate your business rules/validation logic? I understand argument validation. And I understand property validation which can be attached to the models themselves and do things like check that an email a...

Or more complicated:
49
Q: Where to put global rules validation in DDD

Sergey BerezovskiyI'm new to DDD, and I'm trying to apply it in real life. There is no questions about such validation logic, as null check, empty strings check, etc - that goes directly to entity constructor/property. But where to put validation of some global rules like 'Unique user name'? So, we have entity Us...

 
12:52 PM
YAWN
Mornin'
 
hey
 
Howdy
 
Howdy
 
War
sup
 
1:07 PM
hola
 
What's everyone doing this morning?
 
T4 templating
fixing circular references
 
War
ass about face writing code then reverse engineering requirements from it
it's how we roll now apparently
 
1:23 PM
@War that's like rolling uphill?
 
War
@juanvan more like falling up a skyscraper and spreading your guts all over the sky
cuz why not right!!!
 
Dr Strange version
 
War
I mean we all build houses from the roof down yeh?
 
Boys, how are you validating GUIDs?
 
War
@QuietNaN regex
 
1:25 PM
Can you share?
 
War
as long as it follows the formatting constraints its valid
 
you mean 00000000-0000-0000-0000-000000000000
 
War
\A\{[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\}\z
 
So I have an Org_OrgContact table (That contacts orgs and contacts that are associated with those orgs)

The table columns are: [ContactID] , [OrgNumber]

I want to write a SQL query to get all the org numbers that are *common* between ContactID = 2 and ContactID = 4.

This seems simple.. but I'm not very experienced at all with sql
 
War
if the value meets the given regex then its valid
 
1:27 PM
Yes but, you consider GUID as valid if it has all 0 or A s?
 
War
sure why not ??? what makes that invalid?
 
@Michael I'm hazy on what it is you want, can you give a small example? (Also do you want to write a linq statement?)
 
hi guys
i have a big problem
 
What is it?
 
SetOrdinal dosnt work behind me
lets explain more
i have this table
i want to bring the last "num" column to the first position
 
1:35 PM
@Tomwa I wanted SQL, Its okay I think I'm figuring it out slowly. I'll re-ask with more detail if i get stuck again
 
@Michael sounds good, wasn't sure since it's the C# room.
 
good point
 
i have used this code
itemsTable.Columns[10].SetOrdinal(0);
but dosnt work
Crying...
that itemsTable is the DataTable of that datagridview showen in the picture
 
That should work.
 
it dosnt work
it maked me crazy
axxxx
 
1:40 PM
What is happening? Did you inspect the itemsTable object in the debugger?
 
idk why
 
The columns are stored as a List
 
iam beginner sorry
i have created that DT like this
itemsTable = database.CustomSelect("select items.id,items.name,items.buyprice,items.saleprice,items.code,items.quantity,items.smallestamount,itemcategories.name as categoryid,itemstores.name as storeid,items.moreinfo FROM items inner join itemcategories ON items.categoryid=itemcategories.id inner join itemstores ON items.storeid=itemstores.id WHERE deleted='0' AND items.name LIKE '" + textBoxSearchStock.Text.Trim() + "%' LIMIT 20");

                    DataColumn dc = new DataColumn("num", typeof(int));
 
Are you using WinForms or WPF?
 
WinForms
i have TeamViewer if you can
 
1:47 PM
Sure
 
thanks
 
Waiting for it start up
 
thanks man
 
Nice, I can hack you now
 
@HamreenAhmad Why did you post that
 
1:53 PM
As you can see the columns are switching
 
I would change that passcode if i were you
 
I don't think he knows how to PM
It's random gen'ed
 
There is no PM
 
and it's already taken care of
 
but why its dont displayed
in the DGV
 
1:54 PM
But in the future, you shouldn't post teamviewer logins into chat, anyone could've beat me to the login.
That's a good question.
 
ok sorry
 
Someone needs to take security awareness training
 
Guys those should be mod flags. They are not spam/abusive.
 
Guys, please don't flag that. It's not spam / offensive.
 
Let me see if I can check why the datagrid isn't displaying it
 
1:55 PM
I'm in ur compyooter readn ur filez
 
It's something a RO or moderator should remove.
 
@Cerbrus Wow someone flagged it?
 
I don't know if banning him was necessary.
Seems excessive.
Suspension rather.
 
More than 1 person
 
Interesting
 
1:56 PM
"This user has been automatically suspended for posting inappropriate content and cannot chat for 58 minutes."
 
The guy just needed to be made aware not to share that stuff and a mod flag should be raised.
 
Great job, guys -.-
 
Wtf
Were there too many flags?
 
That's what happens when spam flags go through.
Yea
And that's why you don't spam flag things like that.
 
Not too many flags (well actualy any was too many) but people approved them since robo reviewing is fun..
 
1:57 PM
Maybe I should post the flag rules on the sidebar...
 
@bluefeet: You're the first mod I could find in here. Could you unsuspend chat.stackoverflow.com/users/3964205 ? He posted his teamviewer ID / pass in here and was wrongly spamflagged...
 
I'd argue that maybe a UI change is in order. There is only one "flag" icon immediately available, the other one is buried under menus. The difference is not intuitive especially since the option for mod attn is buried.
 
@Cerbrus I was about to summon her...
 
Is blue the only mod that's active in this room?
 
Define "active"
 
2:01 PM
"Stalking" :P
 
@Sidney Sounds like a good idea. Maybe it should give you a choice.
 
room topic changed to C#: gist.github.com - For Easy Code Pasting | stackoverflow.com/help/privileges/flag-posts - Please read the flagging rules before flagging a post as spam [.net] [asp.net] [asp.net-mvc] [c#] [coreclr] [entity-framework] [java-hate] [jicama] [linq] [panini] [php-hate] [visual-studio] [wcf] [wpf]
Maybe madara then?
@Cerbrus Must be a slow morning...
 
Well I am out. Thanks for being cool about the flags.
 
@NathanOliver Peace
 
user4281250
@Tomwa iam that hamrcc1
 
2:11 PM
@HamreenAhmad We are trying to unban you. Sorry
Autoban got you
 
Does anyone have good solutions for how to store ordered items in a database?

I've googled this and there doesnt seem to be any straightforward perfect solution..
 
He's having a really weird issue where SetOrdinal flat out WON'T work for one column.
 
user4281250
thanks man @Failsafe
 
i.e. Any other column SetOrdinal is fine with but SetOrdinal on column 10 doesn't update.
The DataTable's backing list updates of course.
But the DataGridView using it as a source does not.
 
user4281250
i know
 
user4281250
2:13 PM
i try set it to null then equal it again...
 
@Cerbrus appears to have been done already
 
@bluefeet Thanks
 
user4281250
Worked
 
user4281250
@Tomwa
 
user4281250
But like this
 
user4281250
2:14 PM
 
For some reason it seems that column doesn't want to be reordered
 
@bluefeet Okay, thanks for the reply :-)
 
user4281250
yes its weird
 
user4281250
thanks @Tomwa i maked you tired
 
@HamreenAhmad Don't worry about it, it's not a big deal.
 
user4281250
2:17 PM
thx
 
Okay, so I found this as a solution for updating Ordered/sorted values in a table: http://programmers.stackexchange.com/questions/304593/how-to-store-ordered-information-in-a-relational-database

anything wrong it? I don't understand why more people didnt suggest this approach.
 
@HamreenAhmad I have a few other things we can try if you want.
 
user4281250
sure
 
user4281250
send to you again?
 
I sent you an email you can respond to.
 
user4281250
2:24 PM
thanks
 
Please DO NOT post login credentials to your machine.
 
user4281250
ok sorry about that
 
user4281250
i didnt know its not legal
 
It's just not appropriate for a chat room, and I don't want you to get flagged/banned again.
I would advise you to keep personal information like that to yourself/private messaging in order to avoid potential security vulnerabilities on your system.
I would also add that everything you post here is indexed and searchable on google.
 
2:31 PM
any EntityFramework expert here???
 
Maybe
Just ask your question and maybe someone can answer it.
 
Woo, we fixed his problem.
 
user4281250
Thanks @Tomwa
 
user4281250
Why the first Way wouldnt worked?
 
@HamreenAhmad Glad it works
 
user4281250
2:37 PM
I Love You
 
user4281250
....
 
Not sure, the second way using DisplayItems manages the DataGridView directly
 
user4281250
<3
 
So I assume some disconnect between the DataGridView and it's source.
We tried most of the typical update\refresh methods though.
 
user4281250
Yes
 
user4281250
2:38 PM
i saw
 
Just keep in mind that DisplayIndex only updates the datagridview
So you need the SetOrdinal if you ALSO want to update the backing DataTable
 
user4281250
Yes I know
 
Cool bean
 
user4281250
no i dont need DataTable be updated
 
user4281250
that final result what i wanted
 
user4281250
2:40 PM
thanks again...
 
NP, anytime.
 
user4281250
is The Ban not by time?
 
@HamreenAhmad You should be unbanned
 
user4281250
thanks man
 
We messaged a mod and she confirmed that the ban was lifted
 
user4281250
2:42 PM
lets see..
 
What happened was there are two types of flags, spam flags and mod flags. Spam flags will get you auto-banned, and that's what you got ( sorry :( ). Typically it's by an hour, but since you shouldn't have been banned anyway, a mod came in and reversed it. I posted a meta question about changing the interface to make it easier to get the correct flag.
 
thanks... Good Guys
 
Currently at +5
That can't last
 
While I agree Meta is typically a ... Y'know what, I'll just let the votes fly where they may. It's an innocuous feature request, it can't be too bad.
 
I commented on it
for sidney-san
 
2:48 PM
 
I upvoted the question.
I almost took myself out
Went to make a bowl of cereal, the drying rack for dishes is under the cabinet where the cereal is.
On the way to put the cereal down I smacked the handle of a large knife and it swooshed right past my head.
 
nice
 
cereal killer
 
@ntohl wow
 
3:32 PM
What's the best library for logging these days? I'm looking at Microsoft.Extensions.Logging right now, but there seems to be ~a million different logging libraries.
I don't need anything crazy, just basic event logs.
 
nlog
 
Alright, thanks. I'll take a look.
 
I use NLog
Works great even across multiple appdomains
 
Sweet. This is for a fairly simple desktop app. It's just doing sync between two databases.
I might be able to get away with just writing to a file, but part of this project is trying to learn as much C# as possible, so I want to learn the right way to do things.
 
It's easy to get setup.
 
3:37 PM
Yeah, I've already got it setup.
It reminds me a lot of Python's stdlib logging library, which is what I'm most familiar with.
 
@MorganThrapp +1 for NLog
 
+1 on the +1 for NLog
 
I can't seem to find this anywhere, in a <logger /> key, where would I find the list of possible attributes? Specifically, is there a key to set not a minimum level, but a specific one?
Eg, I want log x to only get messages of info level, not info level and above.
 
@MorganThrapp Instead of Minlevel use levels iirc
 
Thanks. Is there a list of attributes somewhere?
 
3:47 PM
levels="Info" should do it.
Suppose it would be level="Info"
 
@Tomwa Perfect, thanks.
 
4:01 PM
I don't see the point of logging frameworks
.net tracing is powerful enough
Configuring ETW is fiddly, I guess if it helped with that it'd be useful
 
4:15 PM
Jay Hanlon on October 11, 2016
If you write code, you know that you’re more than a list of places where you worked or went to school. However you got to where you are now, what should matter is what you’ve built, and what you can do. Whether you're currently looking for new opportunities or not — and whether you're active on Stack Overflow or not — your Developer Story is the best way to share whatever it is that you take pride in.
 
Is chaining method calls in an if bad? I want to do this:
if (EstablishConnections() && SyncDatabase())
{
    logger.Info("Synced databases.");
}
else
{
    logger.Info("Failed to sync collection. Check error log.");
}
 
Hello everybody. I have some not obviously problem build an uwp app in release mode.
 
> I have some not obviously problem
....wat
 
@MorganThrapp Do you need the return values later? If not I don't see why it would be.
 
@Tomwa I don't. I just wanted to make sure it's not like horribly un-idiomatic or anything.
 
4:23 PM
@Alex Can you ask your question with as much detail as possible?
@MorganThrapp No it's fine.
 
Thanks.
 
The best part about reverse engineering? Absolutely NO IDEA why certain code exists:

if (interval <= 7000 + getExtraMilliseconds())
return;
Yeah but WHY
 
That's how I feel about Server.GetServerObject(). It just returns itself.
Like, wat?
 
Hello everybody. I am sorry, my browser crashed :) So, I have problem running the uwp app in release mode. The app seems to freeze after sending the request using the System.Net.Http.HttpClient class. Here is my code snippet
`
Stream data = hc.GetStreamAsync(new Uri("http://localhost/rest/cover/" + dt.ID + "/" + 800 + "/" + 800)).GetAwaiter().GetResult();
var ms = new MemoryStream();
data.CopyToAsync(ms).GetAwaiter().GetResult();
`
the app doesn't freeze if I build it in debug mode. I am wondering if someone could help me to understand what the problem is.
 
4:59 PM
Why are you calling GetAwaiter?
In fact why block at all
Not obvious why it is different between modes but, the reason is that your code blocks
 
5:26 PM
@Tomwa Wrong Alex got pinged :)
 
@Alex Oops
 
@Alex https://msdn.microsoft.com/en-us/library/system.threading.tasks.task.getawaiter(v=vs.110).aspx

"This method is intended for compiler use rather than for use in application code."
 
Um, where can I find open-source projects of my level to contribute to on GitHub?
 
5:41 PM
check here for more info asp.net/web-api/overview/advanced/…
 
I think we keep pinging the wrong Alex.
 
@Meraj99 You just answered your own question. "on GitHub" :P
 
but where xD
 
What does "Your level" mean?
 
All I see is really-professional-looking stuff...
Well, stuff a 'beginnerish intermediate' can contribute to
 
5:54 PM
Guys so I am using a same model for two different methods
One property in one method is int, and in the other its long
Should i set the property in the model to long
so that in the other method i can do (int)SomeKey
or should i set it to long
I guess I should set it to long so there is no data loss
There will be data loss if i convert a long to int, right?
 
yes...?
 
@Meraj99 You can contribute to a popular and active project. Just look for low-hanging fruit.
 
01:00 - 18:0018:00 - 21:00

« first day (2187 days earlier)      last day (2744 days later) »