VLADLEN
VLADLEN
CC#
Created by Nexen on 12/27/2023 in #help
Making sense of monolith structure and modularity
or u can supply all necessary data in ur queue message
7 replies
CC#
Created by Nexen on 12/27/2023 in #help
Making sense of monolith structure and modularity
maybe u wanna do it like this client -> backend -> queue message sent notification service takes message and enriches model from backend with http request
7 replies
CC#
Created by Nexen on 12/27/2023 in #help
Making sense of monolith structure and modularity
if for some reason u dont want to call ur notification service from client u can just pass all necessary data from backend, but depends on ur conditions
7 replies
CC#
Created by Nexen on 12/27/2023 in #help
Making sense of monolith structure and modularity
one of the approaches for microservices architecture would be client -> notification service -> backend http request for actual data -> client. And it should be fine
7 replies
CC#
Created by stepa on 12/26/2023 in #help
need help with ef
I would suggest to select actors that much ur condition first
var actorIds = await _context.Actors.Where(actor => EF.Functions.Like(actor.Name, $"{FilmActorText}%"))
.Select(x => x.Id)
.ToArrayAsync();
var actorIds = await _context.Actors.Where(actor => EF.Functions.Like(actor.Name, $"{FilmActorText}%"))
.Select(x => x.Id)
.ToArrayAsync();
Then select movies
var result = await _context.Films
.Include(u => u.Janr)
.Include(u => u.Zal)
.Include(u => u.Actors)
.Where(x => x.Actors != null && x.Actors.Any(act => actorIds.Contains(act.Id)))
.OrderByDescending(x => x.Id)
.Skip(recordsToSkip)
.Take(_recordsToTake)
.ToArrayAsync();

var result = await _context.Films
.Include(u => u.Janr)
.Include(u => u.Zal)
.Include(u => u.Actors)
.Where(x => x.Actors != null && x.Actors.Any(act => actorIds.Contains(act.Id)))
.OrderByDescending(x => x.Id)
.Skip(recordsToSkip)
.Take(_recordsToTake)
.ToArrayAsync();

This should work U can also do the same in one request by filtering actors table and joining Movies but my solution should be fine
4 replies
CC#
Created by Erek Hai on 12/26/2023 in #help
More like a mathematical problem than code I guess
90* rotation matrix should look like this ( 0 1 ) (-1 0 )
9 replies
CC#
Created by Erek Hai on 12/26/2023 in #help
More like a mathematical problem than code I guess
thats it i guess https://learn.microsoft.com/en-us/dotnet/api/system.numerics.vector3.transform?view=net-8.0, u can just use third coord as 0 (x,y, 0) coz u are on a plane and create matrix for rotation
9 replies
CC#
Created by Erek Hai on 12/26/2023 in #help
More like a mathematical problem than code I guess
i guess there is should be a build in function in some lib
9 replies
CC#
Created by Erek Hai on 12/26/2023 in #help
More like a mathematical problem than code I guess
u can just rotate 2 vectors from which ur ship is constructed https://stackoverflow.com/questions/22818531/how-to-rotate-2d-vector
9 replies