Skip to content

Instantly share code, notes, and snippets.

@shanji97
shanji97 / UserRegistrationDtoValidator.cs
Created February 20, 2026 09:58
A Fluent validation example I use in my template projects with some advanced methods, and some basic validator nesting.
using FluentValidation;
using MediaForgeProductions.Core.DTO;
using Microsoft.Extensions.Caching.Hybrid;
namespace MediaForgeProductions.Validators;
public class UserRegistrationDtoValidator : AbstractValidator<UserRegistrationDto>
{
private readonly HybridCache _cache;
@shanji97
shanji97 / Program.cs
Created December 3, 2023 21:24
Swagger issue.
using Carter;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Microsoft.IdentityModel.Tokens;
using Microsoft.OpenApi.Models;
using RSO.Core.BL;
using RSO.Core.Configurations;
using RSO.Core.Models;
using RSO.Core.Repository;
@shanji97
shanji97 / Dockerfile
Created July 20, 2023 10:20
Docker command failed with exit code 1
FROM mcr.microsoft.com/dotnet/aspnet:6.0 as base
ENV ASPNETCORE_ENVIRONMENT=Development
WORKDIR /app
#Expose ports
EXPOSE 80
EXPOSE 443
#Set up build image
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build