Skip to content

Instantly share code, notes, and snippets.

View fatihdumanli's full-sized avatar
🎯
Focusing

Fatih fatihdumanli

🎯
Focusing
View GitHub Profile
<Grid Background="#FFB2A3A3">
<Grid.RowDefinitions>
<RowDefinition Height="90*"></RowDefinition>
<RowDefinition Height="10*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
int kactane = 0;
int i = 0;
for (i = 0; i < sizeof(dizi); i++)
{
if (dizi[i] == '.')
{
while (dizi[i] != '\0')
@fatihdumanli
fatihdumanli / cs
Last active October 31, 2020 19:21
CustomAuthProvider.cs
public class CustomAuthProvider : ServiceStack.Auth.CredentialsAuthProvider
{
}
@fatihdumanli
fatihdumanli / cs
Last active October 31, 2020 19:27
Startup.cs
Plugins.Add(new AuthFeature(() => new AuthUserSession(),
new IAuthProvider[] {
new CustomAuthProvider()
}));
@fatihdumanli
fatihdumanli / CustomAuthRepository.cs
Last active October 31, 2020 21:02
CustomAuthRepository - fills the gap between persistance and our CustomAuthProvider
public class CustomAuthRepository : IUserAuthRepository
{
private readonly SiteInformationDbContext _context;
public CustomAuthRepository()
{
_context = new SiteInformationDbContext();
}
public IUserAuthDetails CreateOrMergeAuthSession(IAuthSession authSession, IAuthTokens tokens)
@fatihdumanli
fatihdumanli / Startup.cs
Created October 31, 2020 21:18
Registering CustomAuthRepository to built-in IoC container.
public override void Configure(Container container)
{
var userRepo = new SiteAuthRepository();
container.Register<IUserAuthRepository>(userRepo);
}
@fatihdumanli
fatihdumanli / IMessage.cs
Last active November 3, 2020 20:15
IMessage interface
namespace EventTower
{
//Marker interface for messages
public interface IMessage
{
}
}
@fatihdumanli
fatihdumanli / ICommand.cs
Last active November 3, 2020 20:14
ICommand interfae
namespace EventTower
{
//Marker interface for commands
public interface ICommand : IMessage
{
}
}
@fatihdumanli
fatihdumanli / IEvent.cs
Last active November 3, 2020 20:14
IEvent interface
namespace EventTower
{
//Marker interface for events
public interface IEvent : IMessage
{
}
}
@fatihdumanli
fatihdumanli / MyService.cs
Created November 3, 2020 06:45
Secured service
[Route("/user/{UserId}/set/email", "POST")]
[Authenticate]
public class SetEmail : IReturn<bool>
{
public Guid UserId { get; set; }
public string Email { get; set; }
}