« first day (3636 days earlier)      last day (1298 days later) » 

9:00 AM
hi
Having an issue
IQueryable<Plans> query =_context.Set<Plans>().FromSqlRaw("DELETE FROM Plans WHERE Plans.WorkPlanID = {0}", workplanID); //there will be multiple rows
//how should I execute this ?
I want to delete some rows with raw statement in ef core. Am I doing it right ?
 
No
I think what you wana do it context.Database.ExecuteSqlRaw.
If i am not mistaken.
 
ALso that returns an int which giffs you the amount of rows affected
 
is that possible in ef core ?
 
9:03 AM
ok checking
 
Yeah that looks right to me
 
so in that case there is no need for generic methods
 
mr5
Starlink could eventually make Earth act as a Dyson sphere in the future.
 
my query will be valid if I use a select statement
then I can make tolist
 
9:06 AM
@mr5 No it wouldn't.
Where do you get your shitty news from?
 
mr5
myself xD
it's my thought
 
How did you think p3k got so retarded
 
Go to the corner and put on your hat.
 
mr5
lyk bot lyk owner
 
Fucking teamviewer is useless
 
mr5
9:08 AM
it's not a conspiracy, I said "could eventually"...
 
What is a BindingProperty, and how is it used in Conjunction with a BindingObject?
This is what I tried:
namespace XamarinApp
{
	public partial class LoginPage : ContentPage
	{
		public BindableProperty LabelHeight
		{
			get => LabelHeight;
			set => LabelHeight = BindableProperty.Create("LabelHeight", typeof(double), typeof(double), DeviceDisplay.MainDisplayInfo.Height / 2);
		}
		public LoginPage()
		{
			InitializeComponent();
		}

	}
}
 
use AnyDesk
 
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="XamarinApp.LoginPage">
	<ContentPage.Content>
		<StackLayout>
			<Label
				BackgroundColor="LightBlue"
				HeightRequest="{Binding LabelHeight}"
				HorizontalOptions="FillAndExpand"
				HorizontalTextAlignment="Center"
				Text="Welcome"
				TextColor="White"
				VerticalOptions="Start"
				VerticalTextAlignment="Center"
But it does not work...
 
@bluetoothfx I have to bring this one in: Why not just do it with method calls? The point of EF is to not have to use raw sql. Just go context-Plans.Delete(p => p.WorkPlanID == planToRemove).
or p => plansToRemove.Contains(p.WorkPlanID) for multiple plans.
 
mr5
@d4rk4ng31 tis wrong
 
9:12 AM
that would be easy
 
@mr5 That's what
 
my Generic methods using _context.Set<EntityName>().bla bla
 
mr5
no. I don't want to go there @d4rk4ng31
 
@mr5 We'll simply keep cluttering this room
Anyways, please tell me what's wrong
 
_context.Set<T>().Remove(t);
 
9:15 AM
If your app is not a really really small app, your business logic should not know how the database works. So make a DAL with a method DeletePlans(params Plan[] plansToDelete) or something and have the DAL translate that to the database.
 
this is the method of generic class
@Squirrelkiller yes I was just looking a way to use generic function. If I make a custom class, yeah that would be possible.
 
If you use the generic class, there still has to be some class that knows what sql to write or how certain entities look like
 
I don't know how much generic it is, but in all methods I am using this _context.Set<T>()
 
Well if you remove a plan, which class is responsible for telling the database what the ID field is called?
business logic goes "Delete plan number 3 please" - who tells the db that the id field is called WorkPlanID?
 
9:19 AM
@mr5 Ty :))
 
yes
 
mr5
@d4rk4ng31 is it working now?
 
it is taking an object or range of objects
 
mr5
where tf do you get your info about XF though?
 
Wait, lemme understand that first :)
 
9:20 AM
not taking any function
 
mr5
everything you said isn't working for you.
 
so that's why I am looking for a way, without selecting if there is a way to delete
 
@mr5, can you see the comments there?
 
yo yo yo
 
mr5
9:23 AM
@d4rk4ng31 yes
hey cupofjava. when you gonna shift to kotlin?
 
@Squirrelkiller sorry if I disappoint you :P
@mr5 he is not convinced yet
 
mr5
java is still fast though
 
Java is fast, but Java doesnt have fun
 
@bluetoothfx Oh I just translated your raw sql to EF calls. No selecting involved - the call will be translated to SQL and sent to the database and executed there.
 
would you mind sharing ?
 
9:25 AM
fun story, I've actually met James Gosling. He's a really nice guy.
java always holds a place in my heart
 
Nice
@bluetoothfx I already shared - it was my first answer to your original question
 
context.Database.ExecuteSqlRaw. ??
so far this is the way without making select operation , right ?
 
mr5
@CupOfJava pics or you're lying
 
I guess I'm lying
 
I'm not posting a photo of myself in a chatroom
 
mr5
y not
it's C#
you're safe
 
I haven't seen that one yet
 
mr5
the only troubling thing about posting your own pic here is making a meme of your face xD
 
maybe someday
not today
 
9:33 AM
@mr5, you there?
 
mr5
no
 
lol
 
mr5
I edited the gist
 
see the comments please :)
Oh! Okay wait!
I am having trouble with BindableHelper
There's no such thing in my Libraries
Oops wait
Got it
 
mr5
I forgot to edit the code. It was on other class in my codebase.
 
9:35 AM
So, this is what I understood
You need to create a BindableProperty in the class
Then edit the property with Get and Set
and use it with Binding
correct?
 
Wait are you just trying to bind the contents of a button (for example) to the text of a property or what
Sounds like it's getting way overcomplicated
 
mr5
sorry. was talking with my gf.
yeah. I didn't notice what he's trying to accomplish. the one I'm telling him is used only when designing your own control.
 
@mr5 pics or you're lying
 
mr5
otherwise, just override INPC and install Fody.PropertyChanged.
 
I was just trolling. I don't actually want pics
 
mr5
9:49 AM
 
lol
well played
 
mr5
isn't she lovely
 
5 out of 10
 
mr5
why people from west not wearing mask anymore?
 
stupidity
 
9:55 AM
because when you put on a mask you can't see the flat earth
 
mr5
I mean, these are smart people:
the interview was done with none of them wearing any mask. Although I suppose they distanced themselves enough but still
 
It's pretty hard to do an interview with a mask on
I'm sure they were both tested before hand
maybe
 
@CupOfJava ^
 
XD
 
mr5
See the whole function at once to understand it and not resorting into remembering things as you scroll.
 
10:05 AM
that works if you're not in a team
 
mr5
so it wouldn't work if you use K&R style?
 
10:36 AM
@mr5 If your method is so big and convoluted that you need to scroll, then your method is too big and convoluted. It also has too many responsibilities at once.
Extract additional methods
Maybe extract some responsibilities to different classes
 
||votekick mr5
 
@Squirrelintraining voted to kick @mr5
 
mr5
yeah, I always design my method as small as possible. The problem still applies though, cuz there will be a lot of methods now that you extract it to smaller possible subsets.
this was my very first self-made task on my previous employer: gist.github.com/mr5z/83f33a22e4d39db7970fccdbe68e0ba4
to replace all the occurrence of deprecated function signature in their giant code base.
 
10:53 AM
Hi all
 
Hi all, HashAlgorithmName isn't deserialized in [FromBody] , any idea why
 
@mshwf 1) show actual json 2) show endpoint signature 3) show dto class
 
var signingRequest = new SigningRequest
{
    Data = Encoding.ASCII.GetBytes(str),
    SigningHashAlgorithm = HashAlgorithmName.SHA256
};
var modelJson = JsonSerializer.Serialize(signingRequest);
var postData = new StringContent(modelJson, Encoding.UTF8, "application/json");
var res = client.PostAsync("api/DataSigner/SignSR", postData);
        [HttpPost("SignSR")]
        public Response<byte[]> Sign([FromBody] SigningRequest signingRequest)
 
Same application, same SigningRequest class?
 
Two projects: client& DataService.
Yes same model
 
11:02 AM
Route set correctly? Controller like [RoutePrefix("api/DataSigner")]?
Like, does the call actually arrive?
 
Yes, and the data is present but the hashAlgorithm not there (Name is null)
 
mr5
you have two conflicting encoding used there.
 
What do you mean?
 
mr5
welp, not really conflicting since UTF8 will be honored at the end of all data transformation.
in your signingRequest, you said to encode .Data in ASCII but then decided to send it as UTF8 anyway
 
Data is just a byte[] though
 
mr5
11:10 AM
what if str has non-ascii parts?
 
SigningHashAlgorithm is an enum?
 
11:27 AM
did another sketch lul
is it me or do the hips look wrong?
 
mr5
looks fine to me
@Freerey what tweets are trending in your country rn?
 
@mshwf Can I see the SigningRequest class?
@Freerey I think it looks strange in that area because you see the legs while they are still inside the dress so you shouldn't be able to see them.
 
well I didn't necessarily draw clothes lol
I like to just think she has pants on
 
SO chat also deos italic emoti @CaptainObvious
 
11:36 AM
@mr5 uhh there's Boogie, "Christian", Chadwick Boseman, Nobel peace Prize
 
mr5
@Freerey thanks! I also saw this: trends24.in/united-states
 
I know the first one is trending cause boogie2988 supposedly had someone come to his front yard, so he held them at gunpoint
 
mr5
while the trending tweets in my country are full of KPOP and teenage stuffs.
I'm becoming old. I know cuz I'm hating at teenager things.
 
@mr5 succs 2bu
 
Interseting
 
mr5
11:40 AM
everything succs about me and my country </3
 
@mr5 there's lots of that in the US x-x
 
That's because america sucks too
 
US and A succs 2
Lee o/
 
11:41 AM
we don't need your racism
 
It's not racism if it's common knowledge :P
 
mr5
@Squirrelintraining you're too late. I figure it out before anyone else.
 
p3k mimi you're "toooo late"
 
@Squirrelintraining "Did you know that despite making up 13% of the population, black people commit over 50% of the crime?" 🤔
 
@Freerey 🤣🤣
 
mr5
11:43 AM
@Freerey "what more if they make the 50% population" 🤔
 
 using System.Security.Cryptography;

    namespace DataModels
    {
        public class SigningRequest
        {
            public byte[] Data { get; set; }
            public HashAlgorithmName SigningHashAlgorithm { get; set; }
        }
    }
@Squirrelkiller ^
 
Looks normal enough to me
 
mr5
are you sure they are using the same version of HashAlgorithmName assembly version? @mshwf
log the serialized data on the client side first. make sure it got it right before sending the request.
 
@mr5 it's the same class
in the client SigningHashAlgorithm.Name is assigned "SHA256",
but the API SigningHashAlgorithm.Name null
 
Wait, null? How is that possible?
 
mr5
11:50 AM
is client and server side code running in the same computer and environment?
 
A struct can not be null
It's a value type
 
mr5
the name is a string though
 
@Squirrelkiller not the struct, Name property of the struct
 
mr5
prolly the SHA256 isn't supported by the CLR
 
Ah I see
 
11:51 AM
@mr5 Yes, same sollution
 
mr5
check the client and server runtime env. log the System.Environment.Version
 
Both 3.1.7
 
Is the struct readonly or the name of the struct readonly? In that case the deserializer cannot do it, because basically it will first create the SigningRequest-object, then go request.SigningHashAlgorithm = new HashAlgorithm(), then go request.SigningHashAlgorithm.Name = json.Name. So when the name itself is readonly, the deserialization will fail.
 
mr5
or typeof(HashAlgorithmName).Assembly.GetExecutingAssembly().GetName().Version for client and server side.
yeah prolly sqrqrlqrlkiller is right
maybe change the type to just string only.
ugh no
30 mins ago, by mr5
@mshwf https://dotnetfiddle.net/pfnlhY
it actually works for deserialization.
maybe that server deserializer is the culprit.
 
Ah I see
@mshwf As your lawyer rubber duck you should know that you really need to tell me everything you did.
 
12:02 PM
I will pass the hash name instead of this struct, the struct then can be instantiated using HashAlgorithm("SHA256")
 
Hello, could someone help me with a question about good practices of entity framework?
 
Don't äsk
JUST ÄSK
If nö 1 Answers
nö1 knows
2 late already read
 
I'm writing the question, I accidentaly pressed return
 
I thoguth so ☺
 
btw guess who managed to make one of those discord webhooks? now I can make announcements through curl on Linux
which is awesome cause I don't anticipate being on Discord much for the rest of the year
 
12:11 PM
Which makes sense because discord is full of 12 year olds liike @Harry
 
lol y'know that's funny
cause part of the reason I left is cause I found out my writing protégé is being apprehended by a p*do and she's totally okay with it
 
@CaptainObvious Yeah lika that tasty roach!
 
so I'm like "if you can't see why this is a problem, I don't wanna be friends anymore"
 
Drama Llama
 
btw if anyone wants to be a mod on my server, I still got one more slot :P
 
12:13 PM
No thanks
 
Me and my coworker were discussing about mapping tables and views in entity framework.
We work in a university and we are makeing the documents of the students available at our website. But for the student see the document he needs to enter a authentication code, then he gets the document.
The information of the document is based in 3 tables, then we could use a view(sql) for showing the data because it would much easiear and simple.

But the question is: what's the best option, create a view in sql and map it to entity framework; or create the 3 tables in entity framework, map them and the
I would like to know when it's a better to use just a mapped view or create every table and map it and then fetch the data through ".Include" in C#
 
mr5
@CaptainObvious rekt
y so mean guys lol
 
@AlanNunes use a view if you ever re-arrange DB no need to redeploy code.
 
It depends 😊
IIRC If you're using code first it might prove a bit impossible to create views as POCO.
SO if you're using DB First i think applying views is just fine.
But then again most likely it doesn't really matter.
I should stop chatting I am feeling to muchj trollish
 
Thank you for replies
I am using DDD architecture, does it matter in this context?
 
12:20 PM
👍
 
"I should stop chatting I am feeling to muchj trollish"

why?
 
🙊
@AlanNunes Good question.
 
@AlanNunes Not sure what you mean by DDD architecture, DDD is a design paradigm. AFAIK hexagonal is usually used with that though.
@AlanNunes It's probably faster to create the view in sql and query that than to do it via EF. Although not too much, so check what is best for you guys.
 
Killerino
Send me home pl0x
I no wana w0rk no more.
 
Yes, I think the same. It is better for us just to use a view. Thank you
 
12:26 PM
@Squirrelintraining Go the fuck home
 
pull out my muatra, tell 'em "you know what to do, s'wit"
 
@Squirrelkiller 🙏🙇‍♂️
 
12:41 PM
\o
!~shiba
 
are all these Shiba pics taken in Japan? cause this one clearly is :P
 
this one clearly is yes
I guess most of them yes
if not all
shibas are expensive af over here
1-2k €
 
1:01 PM
yeah I bet; those kinds of purebred animal usually are
 
@Squirrelkiller Can yous end me home too
 
and you almost never find them in animal shelters; they're always sold by a farmer or something
 
@CaptainObvious Go the fuck home
 
we have something better than shiba in germany
 
1:05 PM
Fuck them
 
wish I could have a husky T-T
 
its not a husky
 
the even come as small sized versions
 
I know; I'm just saying I'd like a husky :P
 
1:06 PM
 
damn that's a good cosplay
 
"wtf hoomaan"
looks hilarious
 
You want some wtf
 
don't eat stale honey-roasted peanuts
I didn't even mean to get the honey ones, but I would've thought keeping them in the can would be fine
 
That is...some weird, overly-specific wtf, but I can live with that
 
1:16 PM
 
xD
he is a good boi
dogs have no shame
they also try to bang human legs
 
He never did that
He was more into pillows
 
I see
 
1:35 PM
bing.com/… wtf bing
that right sidebar
 
What about it
 
look at how much unnecessary shit ist here
why is "lyrics" on this thing?
 
> lyrics
lol
 
and then there are other sections that make the 503 error sound like some kind of illness
 
It is tho
Your service is poorly ill if it's spitting out 503s
 
1:38 PM
yo yo yo
 
more like coy coy coy
 
500 = Ill, 503 just means it's on holiday or napping.
 
cough cough cough
 
@Hans1984 You need to get ze testing mein herr.
 
what type of dog is that?
 
1:40 PM
noooooooooo
Dx
hides
no i was just referring to CupOfJava ;)
 
I guess it's a deformed German Shepard a.k.a. Alsation. It's a breed most favoured with the British Police.
 
who is this CupOfJava, they sound hot
 
Which one
The ones I posted are border collies
The last one is mine
 
cute dog
 
1:43 PM
I'm looking into a new dog rn
 
@hollystyles you are right
 
border collies are meant to be the most intelligent. Right?
 
@Hans1984 That was quick, was the result positive?
 
schäferhund is also used for K-9 units in the U.S.
 
Allegedly they're "one of" the most intelligent
 
1:44 PM
they are highly trainable and therefore very good for police work
 
But he would do well to convince you otherwise
 
and they dont look as cute as shibas so they scare the bad guys even more
 
I wouldn't want to share my house with anything bigger than a Beagle.
Humans are excepted of course LOL
Nice ones that is
 
@Hans1984 silly non-American we don't police with dogs. We police with high powered guns and tanks.
Home of the free, baby
 
:D
Oh right, my bad
 
1:48 PM
XD
 
pow pow pow
blam blam blam
 
That's right, shoot first ask questions later
 
@CupOfJava If you don't know much about Border Collies, don't get a fucking Border Collie.
They're EXTREMELY intelligent dogs, with an EXTREMELY high drive and energy level.
 
I see
 
That intelligence is also used against you and if you don't get them enough PHYSICAL AND METAL exercise they become destructive.
They require A LOT of care and attention.
 
1:51 PM
What are their views on coffee?
 
You reach, I teach
MJ said it but it also applies for the US police
 
I don't know, I never asked.
 
;)
teach with hot lead
 
I used to have 2. Can confirm they're a lot of work
 
These are the things I need to know. What are their views on coffee? What are their long-term plans for peace in the Middle-East?
 
1:54 PM
Had to put one of them down earlier this year because she had major heart issues quite suddenly
 
I'm sorry to hear
 
That's the most recent pitcure of both of them, it was a pain in the arse to get both of them together because they didn't like lying down next to eachothert
It's fine, I got to do #DogsAtPollingStations last year with her
 
aww cute
 
hey I kinda wanted to ask you foreigners something political: what do you think of Joe Biden?
not just compared to the guy already in charge; I mean just Joe in general
 

« first day (3636 days earlier)      last day (1298 days later) »