« first day (3180 days earlier)      last day (1785 days later) » 

3:34 AM
hey guys
is anyone here familiar with the base constructors
I want to know 2 things. 1. What is the resoning behind it is it a syntax thing. meaning you can use the local class as if it where the class calling the base class types? 2. is there special access to different signature constructors I think there is but what are they and again what is the purpose
 
public class Foo:Bar{ public Foo():base() {} }
 
yes that's how you write it
more interested in the implications of it
 
3:51 AM
Because Foo is inherit Bar, call Bar ctor is mandatory in Foo ctor.
You can call different ctor by using signature
public class Foo:Bar{ public Foo(string name):base(name) {} }
public class Foo:Bar{ public Foo(string name):base() {} }
 
what do you mean by that last part
the base name would be from Bar correct
and you could use this.name to identify your local property
is that right?
 
base() mean the base class, the base class of Foo is Bar
 
You do not have to use this.
 
so you are using name of bar in the base
but you could use this as an identifier if you wanted ot
to
is that right
i.e. this.name is different than the name from the base class
in your example
 
3:54 AM
the variable name is from Foo ctor parameter, you cant use this. on it
 
i mean inside the constructor
but yes I see what you're saying
 
Unless Foo class has a prop/field named name too. But it was wrong naming, it should be Name
 
so name is the paraemeter you are sending to the base ctor
so is this then a way to just instantiate the base ctor
is that the purpose
 
Yes. And it is mandatory.
 
what if the base ctor has multiple signatures i.e. one with a param and one not with a param
 
3:58 AM
The case on my example, the Bar class already have multiple ctor
 
One is parameterless ctor(), One is ctor(string)
 
so you still need to do this even if you arent' using a param
 
yes, you still need to call base()
 
ok so what has priority the no param or param
sorry what is ran first
 
4:00 AM
There is no priority between signatures, because method signature cant be ambiguous
 
ok i thought i read something that said there is a priority between either base class and the class itself or just internal to the base class
is this base ctor thing new in c# because the book I am reading didn't have it in there
 
No. the base() in C# is exist when Im born
It was important to inherit other class, without it, inheritance might not worked or class only can be inherit from parameterless ctor
 
you were born last week?
lol
ok last question on in
in java you always have to have a default constructor even if it's empty
is this the same
can you skip the empty default ctor
 
Yes. If you dont wrote a ctor, there is a default ctor behind it.
 
no i mean can you write a param ctor without the default
empty
 
4:11 AM
public class Foo:Bar{ }
Just same like auto-property. the ctor is auto generated when compilation if you dont wrote any of them.
@ChristianMatthew Sorry its typo
I mean base() is already exist when IT born
In 2002
 
5:16 AM
@ChristianM what do you mean 'priority'?
 
the base ctor over local ctor
i am trying to remember what I read
there was something about priority and skipping an empty param ctor
 
the base must be executed first, because the derived class needs a valid base object before it can add to it, if thats what youre talking about. ?
 
oh yes that makes sense
derived class meaning local class?
or no the base class correct
 
no idea..its just like any other function: there can be many overloads. if the signatures dont match, priority has nothing to do with it. maybe you mean if both classes have a same function? ie. Override ...you could call either, depending how you refer to the object (as parent or child) ...similar story with interfaces iirc.
local class? unknown to me.
 
sorry what do you mean by "derived class"
is that the base class
 
5:26 AM
what does derived mean in english
 
came from
 
now its obvious?
 
i get that but where is our starting point
that is why i am calling that the local class
 
stop calling it that. : )
 
lol why
that's what I am asking
 
5:27 AM
base/derived, or parent/child is the convention.
starting point....child or parent?
which exists first..
 
ok i got ya
wait that's confusing
child or parent
base is the same as derived
I am thinking that the parent is the base class
 
??
no.
 
public class foo : bar { public foo : base(nameof(foo)) {} } << foo is the???
 
were creating foo now, so apparently were adding to base. ?
 
yes so bar is the base class
derived is the foo child class?
that's confusing
 
5:32 AM
base and derived, child and parent.
the relationships are obvious in daily life. why confusing here?
 
to me the parent class is the base class
that's the confusing part
 
it is..
parent existed first..
 
correct
 
and the confusion?
 
but the word derived literally would be dervived from the base class
 
5:33 AM
indeed.
 
it's the word derive
 
the confusion?
im off .
 
so derived from and parent are one thing. child and???
see child and base are not a thing
because the base class is the derived class
lol am wrong about that?
 
5:58 AM
hi @Rob
is a the derived class the base class and if so what do you call the local class
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' pleberinos!
 
what is a pleberinos
 
You, ABuckau, anybody realy
 
6:26 AM
ohayou
 
7:08 AM
good morning
 
Hi
can someone please help withhttps://stackoverflow.com/questions/56831253/what-is-the-correct-datetime-cast-for-a-qureytype-in-efcore
0
Q: What is the correct datetime-cast for a QureyType in EFCore?

KovuI have a view in my database I want to read with EFCore. The data I read with my view is a int column which I can convert into the correct date by this SQL statement: CONVERT(NVARCHAR, DATEADD(MI, wf_activate, '1899-30-12'), 101) + ' ' + CONVERT(NVARCHAR, DATEADD(MI, wf_activate, '1899-30-12'),...

Someone here?
 
maybe
 
Then help me pls
its urgent
I have to work
 
noone else have to work here... We all here to serve you
btw you didn't post part how you attach that sql statement to the flow
in EF you would run a stored proc?
 
@Kovu re-read the error message
the issue and solution sound quite straight forward
 
7:19 AM
it isnt
 
the solution is not so straight forward
 
but I would please if you help me :)
 
the problem is
 
(hint: does this look like a datetime to you? "12/17/2018 12-17-2018")
 
the problem is a view doesnt have a datatype as a table
Ah its a copy paste problem of the question
I will edit it
Tried now 10 different converts
and casts
no chance
 
7:31 AM
> (hint: does this look like a datetime to you? "12/17/2018 12-17-2018")
"12/17/2018 12-17-2018" does not look like a datetime to me
 
as I said
it was a error in my Question
in real life there is a time
CONVERT(NVARCHAR, DATEADD(MI, wf_activate, '1899-30-12'), 0)
Its time and date
e.g.
 
then your question is wrong, I cant give you an answer to a question that I dont know
 
what would people from 1899 say if they knew we were doing date operations on processing computers well over 100 years into the future?
probably "what the hell is a com-put-er?"
 
@Kovu why convert to a string? just do the DATEADD and leave it at that, that is what the error message tells you. There is only ONE time you should ever convert a date to a string and that's for presentation in a view NOT back-end binding code.
 
@Neil yep yep yep yep yep
 
7:42 AM
morning
 
@Niel Ada Lovelace would have known how to fix this
 
@Kovu Your problem is more likely related to TSQL rather than EFCore. BTW, I like typing dates like 18991230 to avoid problems, works like a charm
 
@bradbury9 Why not ISO?
1899-12-30T00:00:00Z
Also supported by pretty much every parser in existence in every language.
 
Morning Kiddiewinks
ISO8601 is also supported by most humans too
 
Whatever format is used, it should include the day and the time, not "mm/dd/yyyy[space]mm/dd/yyyy"
 
7:54 AM
ahoy mateys o/
 
It would be as easi as convert(datetime, CONVERT(NVARCHAR, DATEADD(MI, wf_activate, '18991230'), 101))
 
@bradbury9 and it should not have days between months and years
 
the nested convert gets rid of the not wanted time, and the outer one return the datetime, so EF recieves a datetime and does his magic
morning Squirrel
 
@CaptainObvious Fu, I support you!
 
Ahoy o7
 
7:59 AM
Fuck me
ISO specs are expensive
 

« first day (3180 days earlier)      last day (1785 days later) »