Dreams
Dreams
CC#
Created by Dreams on 12/25/2022 in #help
❔ How bad is this Linq code?
if (getBeginningContent == false)
dynContentList = await _context.DynamicContents
.OrderBy(x => x.OrderIndex)
.Where(i => !i.Name.Contains("resume-header"))
.Where(i => !i.Name.Contains("navbar"))
.Where(i => !i.Name.Contains("social-media"))
.Where(i => !i.Name.Contains("resume-info-cards"))
.Select(d => new DynamicContentDTO(d))
.ToListAsync();
else
dynContentList = await _context.DynamicContents
.OrderBy(x => x.OrderIndex)
//.Where(i => strArray.Any(i.Name.Contains))
//.Where(i => strArray.Any(s => i.Name.Contains(s)))
.Where(i => i.Name.Contains("resume-header") ||
i.Name.Contains("navbar") ||
i.Name.Contains("social-media") ||
i.Name.Contains("resume-info-cards"))
.Select(d => new DynamicContentDTO(d))
.ToListAsync();
if (getBeginningContent == false)
dynContentList = await _context.DynamicContents
.OrderBy(x => x.OrderIndex)
.Where(i => !i.Name.Contains("resume-header"))
.Where(i => !i.Name.Contains("navbar"))
.Where(i => !i.Name.Contains("social-media"))
.Where(i => !i.Name.Contains("resume-info-cards"))
.Select(d => new DynamicContentDTO(d))
.ToListAsync();
else
dynContentList = await _context.DynamicContents
.OrderBy(x => x.OrderIndex)
//.Where(i => strArray.Any(i.Name.Contains))
//.Where(i => strArray.Any(s => i.Name.Contains(s)))
.Where(i => i.Name.Contains("resume-header") ||
i.Name.Contains("navbar") ||
i.Name.Contains("social-media") ||
i.Name.Contains("resume-info-cards"))
.Select(d => new DynamicContentDTO(d))
.ToListAsync();
8 replies
CC#
Created by Dreams on 12/24/2022 in #help
Enabling caching in Nginx
Is there something in my setup files that is disabling caching for my API? /etc/nginx/nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 768;
# multi_accept on;
}

http {
##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

server_names_hash_bucket_size 128;
include nginx-SalonML.conf;
include nginx-SalonML_API.conf;
}
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 768;
# multi_accept on;
}

http {
##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

server_names_hash_bucket_size 128;
include nginx-SalonML.conf;
include nginx-SalonML_API.conf;
}
4 replies
CC#
Created by Dreams on 12/24/2022 in #help
Nginx serving static files with ETag but not ASPNET requests
How can I add ETag support for my API calls? Is this something to add in Nginx, Kestrel, or ASPNET?
3 replies
CC#
Created by Dreams on 12/24/2022 in #help
Where to add ETag for API?
All my static files look like they are being ETag cached, but I have an API that I'd like to be cached too I'm using Nginx for static files + API, and Kestrel for API (that's about as far as I understand)
1 replies
CC#
Created by Dreams on 12/24/2022 in #help
❔ Linq statement doesn't work
.Where(i => strArray.Any(s => i.Name.Contains(s)))
.Where(i => strArray.Any(s => i.Name.Contains(s)))
I have an array of strings [ "text1", "text2", "text3"] and I want to find all Names that have a substring such as: text1somethingsomething
10 replies
CC#
Created by Dreams on 12/23/2022 in #help
Linq to select where Name contains substring?
var dynContentList = await _context.DynamicContents
.OrderBy(x => x.OrderIndex)
.Any(i => i.Name.Contains(substring))
.ToListAsync();
var dynContentList = await _context.DynamicContents
.OrderBy(x => x.OrderIndex)
.Any(i => i.Name.Contains(substring))
.ToListAsync();
I want to return all rows where the Name field contains a substring
8 replies
CC#
Created by Dreams on 12/20/2022 in #help
❔ How to connect to Azure Key Vault from external VPS?
Instructions for Azure VM was two lines of "Azure code" I'm now using a VM from a third party, is it even possible anymore to keep using Azure Key Vault?
4 replies
CC#
Created by Dreams on 12/20/2022 in #help
❔ Azure VM network very slow
5 replies
CC#
Created by Dreams on 12/16/2022 in #help
❔ Help with EF Core Linq statement
21 replies
CC#
Created by Dreams on 12/16/2022 in #help
❔ API Call really slow (6+ seconds) on first call, then fast (100ms) afterwards
7 replies
CC#
Created by Dreams on 12/7/2022 in #help
❔ What type of variable is this?
6 replies
CC#
Created by Dreams on 12/7/2022 in #help
Do I need Facebook API to host their images?
They give me a 0 byte "OK" when I put their image URL in my src Is the solution to download and host from my API instead?
1 replies
CC#
Created by Dreams on 12/7/2022 in #help
PC and Mobile behave differently
my site: https://delightful-hill-04904a303.2.azurestaticapps.net/ on PC changes are saved in DB on Mobile changes aren't being saved in DB if you want here's my code: https://github.com/dzenis-zigo/Frizerski-Salon-ML
3 replies
CC#
Created by Dreams on 12/7/2022 in #help
Can I have constructor in my EF model?
Can I have constructor to create the model based off of the DTO? Right now I have a constructor to make a DTO based off of the model
6 replies
CC#
Created by Dreams on 12/6/2022 in #help
EF Core Model not-required property
3 replies
CC#
Created by Dreams on 12/5/2022 in #help
Is this SQL design ok?
1 replies
CC#
Created by Dreams on 12/5/2022 in #help
EF SQL question
if I have the following columns:
id | englishL10n | bosnianL10n | dateCreated
id | englishL10n | bosnianL10n | dateCreated
where id and dateCreated are required should I make englishL10n and bosnianL10n required too? my front end would make a POST one at a time (but it could do both if that's better)
4 replies
CC#
Created by Dreams on 12/5/2022 in #help
.Net Identity JWT has weird claim
4 replies
CC#
Created by Dreams on 12/4/2022 in #help
How to structure this DTO?
9 replies
CC#
Created by Dreams on 12/2/2022 in #help
❔ Azure GitHub can't find project file?
MSBUILD : error MSB1009: Project file does not exist. https://github.com/dzenis-zigo/Frizerski-Salon-ML
67 replies