This file contains hidden or 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
| public void ConfigureServices(IServiceCollection services) | |
| { | |
| services.AddScoped<IOrderRepository, SqlServerOrderRepository>(); | |
| services.AddTransient<IMailService, SmtpMailService>(); | |
| } |
This file contains hidden or 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
| public class UserService | |
| { | |
| public IUserRepository UserRepository { get; set; } | |
| public void GetUser(int userId) | |
| { | |
| return UserRepository.GetUserById(userId); | |
| } | |
| } |
This file contains hidden or 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
| public class OrderService | |
| { | |
| private readonly IOrderRepository _repository; | |
| public OrderService(IOrderRepository repository) | |
| { | |
| _repository = repository; | |
| } | |
| public void CreateOrder(Order order) |
This file contains hidden or 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; | |
| var builder = WebApplication.CreateBuilder(args); | |
| builder.Services.AddDatabaseDeveloperPageExceptionFilter(); | |
| builder.Services.AddDbContext<TodoDb>(opt => opt.UseInMemoryDatabase("TodoList")); | |
| var app = builder.Build(); | |
| app.MapGet("/todoitems", async (TodoDb db) => | |
| await db.Todos.Select(x => new TodoItemDTO(x)).ToListAsync()); |
This file contains hidden or 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
| userRoles.set(john, 'admin'); |
This file contains hidden or 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
| -- Rename Table | |
| exec sp_rename '[dbo].[Old_Table_Name]', 'New_Table_Name' | |
| -- Rename Column | |
| EXEC sp_rename 'TableName.Old_Column_Name', 'New_Column_Name', 'COLUMN' |
This file contains hidden or 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
| git update-index --assume-unchanged file-name.extension |
This file contains hidden or 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
| { | |
| "$schema": "https://aka.ms/terminal-profiles-schema", | |
| "actions": [ | |
| { | |
| "command": { | |
| "action": "copy", | |
| "singleLine": false | |
| }, | |
| "keys": "ctrl+c" | |
| }, |
This file contains hidden or 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 namespace System.Management.Automation | |
| using namespace System.Management.Automation.Language | |
| if ($host.Name -eq 'ConsoleHost') | |
| { | |
| Import-Module PSReadLine | |
| } | |
| oh-my-posh --init --shell pwsh --config C:\github\prompt\kazeem.omp.json | Invoke-Expression |
This file contains hidden or 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
| { | |
| "blocks": [ | |
| { | |
| "type": "prompt", | |
| "alignment": "left", | |
| "segments": [ | |
| { | |
| "type": "session", | |
| "style": "diamond", | |
| "foreground": "#ffffff", |
NewerOlder