Refactoring, database structure changed
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
namespace WatchIt.DTO.Models.Controllers.Accounts.AccountBackgroundPicture;
|
||||
|
||||
public class AccountBackgroundPictureRequest
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public Guid Id { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using FluentValidation;
|
||||
using WatchIt.Database;
|
||||
|
||||
namespace WatchIt.DTO.Models.Controllers.Accounts.AccountBackgroundPicture;
|
||||
|
||||
public class AccountBackgroundPictureRequestValidator : AbstractValidator<AccountBackgroundPictureRequest>
|
||||
{
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public AccountBackgroundPictureRequestValidator(DatabaseContext database)
|
||||
{
|
||||
RuleFor(x => x.Id).MustBeIn(database.PhotoBackgrounds, x => x.Id).WithMessage("Background does not exists");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user