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.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
namespace Main; | |
/// <summary> | |
/// Service builder class. | |
/// </summary> | |
public static class ServiceBuilder |
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
namespace DependencyInjectionTest; | |
public interface IDatabaseService | |
{ | |
public void DoStuff(); | |
} |
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
// ICommand interface to extend the commands from | |
interface ICommand | |
{ | |
void ExecuteCommand(); | |
} | |
// First command | |
class HelloCommand : ICommand | |
{ | |
public void ExecuteCommand() |
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
CREATE FUNCTION WORKING_DAY_OF_MONTH | |
( | |
@DayIndex INT, -- Searched day index | |
@Month INT, -- Month | |
@Year INT -- Year | |
) | |
RETURNS INT AS | |
BEGIN | |
DECLARE @Index INT = 1 | |
DECLARE @DaysFound INT = 0 |
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
STUFF( | |
( | |
SELECT ', ' + mt.[TextValue] | |
FROM dbo.[MultiSelect] AS ms | |
LEFT JOIN usr.[MonthType] AS mt ON mt.[Ident] = ms.[Value] AND mt.[LanguageID] = @UserLanguageID | |
WHERE | |
ms.[TableID] = at.[ID] | |
AND ms.[FormIdent] = @FormIdent | |
AND ms.[ControlIdent] = @ControlIdent | |
FOR xml path('') |
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
CREATE FUNCTION [dbo].[StringSplit] ( | |
@stringToSplit NVARCHAR(MAX), | |
@splitCharacter NVARCHAR(1) | |
) | |
RETURNS | |
@returnList TABLE ([Name] [nvarchar] (500)) | |
AS | |
BEGIN | |
DECLARE @name NVARCHAR(255) |