« first day (3961 days earlier)      last day (1211 days later) » 

mr5
mr5
02:15
@Squirrel.98 maybe you like to pass the product model as well in the event?
 
5 hours later…
07:02
In the param?
Good morning
@Squirrel.98 This is the correct way, you got it
07:19
Awesome!
07:41
if you need to return, then you can put the result in a local variable
also, yes, try to provide all meaningful information in events
you tell them what happened, you dont let them ask for what happened
public Task InsertProductDate(ProductDatesModel product)
{
    var x = _productDatesRepository.InsertProductDate(product);
    ProductCreated?.Invoke();
    return x;
}
Like so?
@Wietlol I'll take a look at events
no
what is var here?
@Wietlol That's what I assumed I did?
not necessarily
you did more
you removed your await
In this case, you don't need to return a value.
Don't let The Wiet confuse you
07:58
Yeah I don't think I need to return anything. As I am simply inserting data into DB and triggering the event to let all the subscribers aware of the action.
The only reason I can think of to return something might be a result pattern where you return a Result object that, when its success property is false, carries an error message or exception. But let's be real here if an exception happens, you can just catch it.
Or catch it in the service and fire an OnError event
I remember you mentioned Action<Result>
When I call InsertProductDate(ProductDatesModel product) from the VM, I place it in a try catch {...}
Within catch the messagebox service will display the error.
The only reason I can think of to return something, is when you have more information derived from external factors
when you insert a model into a database, the ORM framework assigns it's ID
usually, this is set into the input model, but if not, then you should see it in the output
and use return to get the new inserted id?
the new model
08:14
I see
you guys still use WinForms?
Oh hell no
That's how i started
Until I discovered WPF
Same lol
But that was solid at first, until I gave it some time to understand it
user16620643
Hello fellas
08:16
yo
user16620643
What do u use c# for personally
Well technically I started with a....web clone of WinForms called Visual WebGUI. Completely different company, but the API was cloned so well we could actually use the MS WinForms docs for it.
@Matthias Currently calculating how many hours I will work during my next semester where I don't have a concrete lecture plan yet.
user16620643
Nice
user16620643
I have no knowledge of C# and have drifted here somehow
So I have 1) start/end dates, 2) obv. no work/lectures on weekends, 3) more work when university has vacation, 4) module information, how much time per week it theoretically takes.
Nice lol. C# is a great language to do many things. Even full stack web dev by now.
My personal project, which is only .NET aside from like 20 lines of javascript:
https://teambuilder.z6.web.core.windows.net/
08:20
I started with JavaScript - C# seems to be my preference by now
nice project
lol whoops, how'd that happen
Your project probs dangerous for our IT guys lol
tbf I don't have any...signing things or whatever lol
https provided by azure though
works ok on at your end?
@Squirrelkiller ew
08:33
@Squirrel.98 Works perfectly fine here^^
mr5
mr5
09:08
dang it
overtime on Friday
I've been stressed at work for almost 3 months already
when is this going to end
09:36
tomorrow
Fair enough
mr5
mr5
09:57
How come there is not a single mention of Axie game here?
When it comes to issues like this - what is the correct thing to do ?
mr5
mr5
Uninstall devexpress
and re-install
mr5
mr5
no
that library is shit
oh
-_-
When was the last time you used it -_-
mr5
mr5
09:59
In my last last company.
Hated it.
How long ago?
mr5
mr5
Just looking at their website gross me out.
like 7 months I think
What did you build?
A website?
@Squirrel.98 Doesn't look like anything to me.
Maybe the library just sucks for web dev. Desktop dev (WPF) is pretty cool.
mr5
mr5
10:02
@Squirrel.98 cross platform, mainly for Windows desktop
WPF package ?
mr5
mr5
no, Xamarin
ax
haven't used it.
But the UI components are easy to use don't you think?
@mr5 This was their response
It looks like your project uses v.21.1.3, but locally you have another version installed (21.1.5). Please try to change the version of the packages in your project. Otherwise, you can change the local version. The main idea is that the local version and a version in the project should be the same.

If it doesn't help, please contact us in the Support Center. Submit a ticket using our Support Center http://www.devexpress.com/ask and describe the issue in detail. It will be helpful if you attach there a project and an installation log.
mr5
mr5
So in your local file system, VS caches the package instead of downloading it every time.
But in your .csproj (provided you are using the latest format), it's looking for a version different than the one you have in your local file system
Maybe try to look in %USERPROFILE%\.nugget
Thats correct I have 21.1.5 installed
I remember downloading it
mr5
mr5
10:12
yeah
so uninstall that
and stop using dev express
problem solved 😏
mrIHateDaveExpress
new name
 
2 hours later…
12:04
12:26
When it comes to storing data on the local machine.. where do you tend to save it.. and what database do you use?
Not SQL
just some sort of file can be saved on local m.
Depends
I save my work hour predictions in %userprofile%/documents/
For projects with development data, there's just a db file in the project directory
If it's real data but part of an application, %appdata%/YourApp is the way to go
Or the install directory if you want it to be the same data for all people on the PC.
13:02
shweet
or let the user choose a directory
is there a way to call a bool method inside a void method without creating vulnerabilities? for example not using the returned value from the bool method
it was like this if(!boolMethod()) return false; but I had to get rid of the return since this call is inside a bool method.
void method
14:19
sounds like XY
ignoring the result of a bool method is not by definition vulnerable
it returns a boolean, but you usually dont care about it
you just care that the item you specified does not exist in the collection after the remove function completed
which is true regardless of the result
so the question depends on what your boolean result means, how that can result in a vulnerability when ignored and why you cannot handle the situation in the void method
@LuDevGon In a void method, you can still call return; to stop the execution of that method then and there.
Yea i used (return;) but SonarQube is complaining about being an redundant jump
That one depends on the whole method though. SonarQube has the whole context, we do not.
because if i just call the boolMethod without using the returned value (which i dont need for this void method) it might create another codesmell for the returned value not being used.
If you active do not need the return value, you can note that by reading it into a discard:
_ = BoolReturningMethod();
This will show both people and analyzers looking at it that you know that you don't need that boolean return value.
Visual Studio will even give you this option when that rule is active, when it tells you about unused return values.
14:34
that will work thanks guys
mr5
mr5
my boss was telling me before he ended reviewing the source code I inherited: "this is lacking of try-catch, we should put try-catch everywhere..."
that shocked me. thought he was joking but he's serious.
try{ main(); }catch(Exception ex){MessageBox.Show(ex.Message);}
^
basic rules of thumb,
1, every entry point in your application (postbacks, events, main, controllers, etc) needs a try catch, to try your action, but catch any errors it has
and the catch, also needs a try catch
always log the error (use lower severity or loglevel if it is less important)
and show the invoker that something went wrong (500 http status, message popups with some text, etc) (some frameworks might help you with placing these on multiple entry points at once)
2, try catches anywhere else need to be justified by expectations.
mr5
mr5
14:54
 
2 hours later…
 
7 hours later…
23:23
Folks, I see line of code where an object is newed-up, but not assigned to a variable.
new MyFooBar();
How does that work? What can that be used for?
[I didn't write that codebase.]
23:45
Ah. I figured out how it works. The constructor registers the new instance with another object, and that reference keeps the instance alive.
I haven't seen that kind of pattern before. I wonder if it's a good pattern.

« first day (3961 days earlier)      last day (1211 days later) »