This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO $$ | |
DECLARE | |
user_name text := 'your_username'; -- Değiştirmeniz gereken kullanıcı adı | |
user_schema text; | |
BEGIN | |
-- Kullanıcının bağlandığı semayı al | |
SELECT current_schemas(true) INTO user_schema; | |
-- Kullanıcıya şema erişim yetkisi ver | |
EXECUTE 'GRANT USAGE ON SCHEMA ' || user_schema || ' TO ' || user_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.DependencyInjection; | |
using TbdFriends.WaterDrinkWater.Data.Contexts; | |
namespace TbdFriends.WaterDrinkWater.Data.Extensions; | |
public static class MigrationExtension | |
{ | |
public static void ApplyMigrations(this IServiceProvider services) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do | |
{ | |
Console.WriteLine("Which database do you want to use? (1 for SQL Server, 2 for PostgreSQL, 3 for Sqlite)"); | |
var readKey = Console.ReadKey(); | |
Console.WriteLine(); | |
Console.WriteLine(); | |
if (readKey.KeyChar == '1') | |
{ | |
ConnectionStrings.Current = ConnectionStrings.SqlServer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.CodeDom.Compiler; | |
using System.Reflection; | |
class Program | |
{ | |
static void Main() | |
{ | |
string code = "public class Person { public int Id {get; set;} public string UserName {get; set;} }"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Security.Cryptography; | |
using System.Text; | |
public class PasswordManager | |
{ | |
public string HashPassword(string password) | |
{ | |
using (SHA256 sha256 = SHA256.Create()) | |
{ |