This problem welding text/plain parameter regedit on windows.
For Solution;
Step1:
Open Regedit.
Step2:
Go to root = HKEY_CLASSES_ROOT\.js\Content Type
Step3:
Change value; text/plain to text/javascript
Step4:
Restart pgAdmin
By!
This problem welding text/plain parameter regedit on windows.
For Solution;
Step1:
Open Regedit.
Step2:
Go to root = HKEY_CLASSES_ROOT\.js\Content Type
Step3:
Change value; text/plain to text/javascript
Step4:
Restart pgAdmin
By!
="update myTable_auth_user inner join 1rs.auth_user on auth_user.id = myTable_auth_user.user_id set identification_number = '"&B2&"', phone='"&C2&"',bank_name='"&D2&"',iban_number='"&E2&"',address='"&F2&"',tax_number='"&H2&"',invoice_name='"&J8&"' where auth_user.email = '"&A2&"';"
Enable Cookies in Project for:
Startup.cs file in insert
app.UseCookiePolicy();
New a cookie create for:
CookieOptions cookie = new CookieOptions(); cookie.Expires = DateTime.Now.AddYears(10); Response.Cookies.Append("username", username, cookie); Response.Cookies.Append("password", password, cookie);
string username = Request.Cookies["username"]; string password = Request.Cookies["password"];
Startup.cs file in;
services.Configure<CookiePolicyOptions>(options => { options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; });
change to:
options.CheckConsentNeeded = context => false;
Create kestrel service:
nano /etc/systemd/system/kestrel-oguzhanabali.com.service
[Unit] Description=Oguzhan ABALI Blog [Service] WorkingDirectory=/var/www/oguzhanabali.com ExecStart=/usr/bin/dotnet /var/www/oguzhanabali.com/OguzhanAbali.dll Restart=always # Restart service after 10 seconds if the dotnet service crashes: RestartSec=10 KillSignal=SIGINT SyslogIdentifier=dotnet-example User=www-data Environment=ASPNETCORE_ENVIRONMENT=Production Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false [Install] WantedBy=multi-user.target
Add the code below:
Environment=ASPNETCORE_URLS=http://localhost:5001
Example appsettings:
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AllowedHosts": "*"
}
Create MyConfig name class and;
using Microsoft.Extensions.Configuration;
static class ConfigurationManager
{
public static IConfiguration AppSetting { get; }
static ConfigurationManager()
{
AppSetting = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.Build();
}
}
Now you can use it like :
string value = ConfigurationManager.AppSetting["value_Key"];
ng build –output-path=../reklamselfie-frontend-dist/public –env=test
ng build –prod –output-path=../reklamselfie-frontend-dist/public
—new version—-
ng build –prod –output-path=../reklamselfie-frontend-dist/public
ng build –configuration=test –output-path=../reklamselfie-frontend-dist/public
————————————————————————-
python manage.py runserver
python manage.py makemigrations blog
python manage.py migration
$ git config –global user.name “Name”
$ git config –global user.email you@example.com
git add -A
$ git commit -m “First commit”
$ git remote add origin https://github.com/<github-user-name>/my-project.git
$ git push -u origin master
Merhabalar,
Projeyi deploy yapmak için build etmeye çalışığımda (ng build –prod) böyle bir hata ile karşılaştım. Git’deki uzun issue incelemelerinden sonra bir sonuca varamadım. Anladığım kullandığım primeng adlı kütüphane webpack sürümüyle uyuşmuyordu webpack’i güncellediğimde ise webpack’in bağlı olduğu extract paketi arıza veriyordu.
Çözüm olarak;
1-npm cache clean
2-Build edeceğiniz bir path verin,
ng build –output-path=<yourpath>
Sorun çözülecektir.
İyi çalışmalar..
Merhabalar,
Dün projeyi deploy etmek için build etmeye çalıştığımda
(ng build –prod)
şöyle bir hata ile karşılaştım;
Module not found: Error: Can’t resolve ‘./$$_gendir/app/app.module.ngfactory’
Kodlarımda veya projemde sorun olmamasına rağmen gitden çekerken bir cacheleme oldu ve bu hatayı vermeye başladı.
Çözüm olarak aot ‘u devre dışı bıraktım;
ng build –prod –aot=false
Yorumlarınızı bekliyorum,
İyi çalışmalar.
Execute SQL query on existing entity
using (var context = new MyDBContext()) { var posts = context.Posts.SqlQuery("SELECT * FROM dbo.Posts").ToList(); }
ToList() is mandatory here, otherwise query will not be executed, make sure you take care of sql injection attack if raw query is used
Execute Stored Procedure on existing entity
using (var context = new MyDBContext()) { var posts = context.Posts.SqlQuery("dbo.spGetTopPosts").ToList(); }
ToList() is mandatory here, otherwise query will not be executed. Above code will execute Stored Procedure ‘spGetTopPosts’
Execute Stored Procedure with parameters on existing entity
using (var context = new MyDBContext()) { var postID = 99; var posts = context.Posts.SqlQuery("dbo.spGetTopPosts @p0", postID).Single(); }
Single() is mandatory here, otherwise query will not be executed. Above code will execute Stored Procedure ‘spGetTopPosts’ with input paramter as postID
Execute SQL query on non-existing entity
using (var context = new MyDBContext()) { var postTitles = context.Database.SqlQuery<string>("SELECT Title FROM dbo.Posts").ToList(); }
Execute SQL query by passing parameters
This is more better raw query as it avoid sql injections
using (var context = new MyDBContext()) { var userSuppliedAuthor = new SqlParameter("@author", "Adi"); context.Database.SqlQuery(typeof(Post), "SELECT * FROM dbo.Posts WHERE Author = @author", userSuppliedAuthor); }
Here the sql statement is executed on Posts table, so typeof(Post) is used. If a join statement is used on two different tables, then need to write an internal class for the returned values of sql statement.
Consider Posts, Category, Posts_Category tables exists. Posts_Category is mapping table of Posts – Id column and Category – Id column. If we want to execute sql join statement use the below code
internal class MappingData { public string CategoryTitle { get; set; } public string PostTitle { get; set; } public long? MappingId { get; set; } } using (var context = new MyDBContext()) { var userSuppliedId = new SqlParameter("@PostId", PostID); string sqlQuery = @"select c.Name CategoryTitle, pcm.Id MappingId, p.Title PostTitle from Posts_Categories pcm join Categories c on pcm.CategoryId = c.Id join Posts p on pcm.PostId = p.Id where pcm.PostId =@PostId"; var Results = db.Database.SqlQuery<MappingData>(sqlQuery,userSuppliedId).ToList(); } Results will be list of Categories of the given Post Execute update SQL statment on non-existing entity using (var context = new MyDBContext()) { context.Database.ExecuteSqlCommand( "UPDATE dbo.Posts SET Title = 'Updated Title' WHERE PostID = 99"); } For better understanding, summary extract of the method ‘SqlQuery’