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 FluentValidation; | |
using Users.API.Application.Commands; | |
namespace Users.API.Application.Validators | |
{ | |
public class CreateUserCommandValidator : AbstractValidator<CreateUserCommand> | |
{ | |
public CreateUserCommandValidator() | |
{ | |
RuleFor(x => x.Email).NotNull().NotEmpty(); |
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 MediatR; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Logging; | |
using System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Users.API.Application.Commands; | |
using Users.API.Application.Queries; |
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) | |
{ | |
// Add Hangfire services. | |
services.AddHangfire(configuration => configuration | |
.SetDataCompatibilityLevel(CompatibilityLevel.Version_170) | |
.UseSimpleAssemblyNameTypeSerializer() | |
.UseRecommendedSerializerSettings() | |
.UseSqlServerStorage(Configuration.GetConnectionString("Hangfire"), new SqlServerStorageOptions | |
{ | |
CommandBatchMaxTimeout = TimeSpan.FromMinutes(5), |
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 Configure(IApplicationBuilder app, IWebHostEnvironment env) | |
{ | |
if (env.IsDevelopment()) | |
{ | |
app.UseDeveloperExceptionPage(); | |
} | |
app.UseRouting(); | |
app.UseAuthorization(); |
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 System; | |
using System.Collections.Generic; | |
using System.Data.SqlClient; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace Sample.API.Services | |
{ | |
public interface ISomeWorkService | |
{ |
OlderNewer