Commit 1b73d6b7 authored by Andres Käver's avatar Andres Käver

bll, dal, mappers

parent a71fa596
......@@ -10,6 +10,9 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DAL.App.EF", "DAL.App.EF\DAL.App.EF.csproj", "{F4E2CB39-92D5-4D43-8F77-5724AB6889CC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Solution Items", "_Solution Items", "{106D1228-800C-42DF-84FC-68ED8F992F04}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Contracts.DAL.Base", "Contracts.DAL.Base\Contracts.DAL.Base.csproj", "{09788B7E-B53A-47B2-A90B-C3F58039C304}"
EndProject
......@@ -37,6 +40,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BLL.App", "BLL.App\BLL.App.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contracts.BLL.App", "Contracts.BLL.App\Contracts.BLL.App.csproj", "{CEB4B60B-3D45-47D5-9A7F-B38A52314D41}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DAL.App.DTO", "DAL.App.DTO\DAL.App.DTO.csproj", "{2DA34762-A194-4B43-8D73-2B886CFB2620}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BLL.App.DTO", "BLL.App.DTO\BLL.App.DTO.csproj", "{4760DDAB-E64D-4571-902D-69F8A28B2BBD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -99,6 +106,14 @@ Global
{CEB4B60B-3D45-47D5-9A7F-B38A52314D41}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CEB4B60B-3D45-47D5-9A7F-B38A52314D41}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CEB4B60B-3D45-47D5-9A7F-B38A52314D41}.Release|Any CPU.Build.0 = Release|Any CPU
{2DA34762-A194-4B43-8D73-2B886CFB2620}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2DA34762-A194-4B43-8D73-2B886CFB2620}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2DA34762-A194-4B43-8D73-2B886CFB2620}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2DA34762-A194-4B43-8D73-2B886CFB2620}.Release|Any CPU.Build.0 = Release|Any CPU
{4760DDAB-E64D-4571-902D-69F8A28B2BBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4760DDAB-E64D-4571-902D-69F8A28B2BBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4760DDAB-E64D-4571-902D-69F8A28B2BBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4760DDAB-E64D-4571-902D-69F8A28B2BBD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -116,5 +131,7 @@ Global
{B01B900B-7340-4E72-B2D2-9E005177F427} = {8B0FADDD-AC52-42E4-BF2D-2C532622DB75}
{50EB1C23-3097-46A0-927E-A579447105BE} = {289BD606-7E46-415F-A90D-3D9442113729}
{CEB4B60B-3D45-47D5-9A7F-B38A52314D41} = {289BD606-7E46-415F-A90D-3D9442113729}
{2DA34762-A194-4B43-8D73-2B886CFB2620} = {8B0FADDD-AC52-42E4-BF2D-2C532622DB75}
{4760DDAB-E64D-4571-902D-69F8A28B2BBD} = {289BD606-7E46-415F-A90D-3D9442113729}
EndGlobalSection
EndGlobal
using System;
using System.Collections.Generic;
using BLL.App.DTO.Identity;
using Contracts.DAL.Base;
namespace BLL.App.DTO
{
public class Animal : Animal<Guid>, IDomainBaseEntity
{
}
public class Animal<TKey> : IDomainBaseEntity<TKey>
where TKey: IEquatable<TKey>
{
public TKey Id { get; set; } = default!;
public virtual string AnimalName { get; set; } = default!;
public virtual int? BirthYear { get; set; }
public TKey AppUserId { get; set; } = default!;
public AppUser<TKey>? AppUser { get; set; }
public virtual ICollection<OwnerAnimal>? Owners { get; set; }
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Contracts.DAL.Base\Contracts.DAL.Base.csproj" />
</ItemGroup>
</Project>
namespace BLL.App.DTO.Identity
{
public class AppRole
{
}
}
\ No newline at end of file
using System;
namespace BLL.App.DTO.Identity
{
public class AppUser : AppUser<Guid>
{
}
public class AppUser<TKey>
where TKey : IEquatable<TKey>
{
public TKey Id { get; set; } = default!;
public virtual string FirstName { get; set; } = default!;
public virtual string LastName { get; set; } = default!;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using BLL.App.DTO.Identity;
using Contracts.DAL.Base;
namespace BLL.App.DTO
{
public class Owner : Owner<Guid>, IDomainBaseEntity
{
}
public class Owner<TKey> : IDomainBaseEntity<TKey>
where TKey: IEquatable<TKey>
{
public TKey Id { get; set; } = default!;
public virtual string FirstName { get; set; } = default!;
public virtual string LastName { get; set; } = default!;
public virtual ICollection<OwnerAnimal>? Animals { get; set; }
public virtual int AnimalCount { get; set; }
public virtual TKey AppUserId{ get; set; } = default!;
public virtual AppUser<TKey>? AppUser { get; set; }
}
}
\ No newline at end of file
using System;
using BLL.App.DTO.Identity;
using Contracts.DAL.Base;
namespace BLL.App.DTO
{
public class OwnerAnimal : OwnerAnimal<Guid>, IDomainBaseEntity
{
}
public class OwnerAnimal<TKey> : IDomainBaseEntity<TKey>
where TKey : IEquatable<TKey>
{
public TKey Id { get; set; } = default!;
public virtual TKey OwnerId { get; set; } = default!;
public virtual Owner? Owner { get; set; }
public virtual TKey AnimalId { get; set; } = default!;
public virtual Animal? Animal { get; set; }
public virtual int OwnedPercentage { get; set; }
public TKey AppUserId { get; set; } = default!;
public AppUser<TKey>? AppUser { get; set; }
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\BLL.App.DTO\BLL.App.DTO.csproj" />
<ProjectReference Include="..\BLL.Base\BLL.Base.csproj" />
<ProjectReference Include="..\Contracts.BLL.App\Contracts.BLL.App.csproj" />
<ProjectReference Include="..\DAL.App.EF\DAL.App.EF.csproj" />
......
using BLL.App.DTO;
using BLL.Base.Mappers;
using BLL.Base.Services;
using Contracts.BLL.App.Services;
using Contracts.BLL.Base.Mappers;
using Contracts.DAL.App;
using Contracts.DAL.App.Repositories;
using Contracts.DAL.Base.Repositories;
using DAL.App.EF;
using Domain;
namespace BLL.App.Services
{
public class AnimalService : BaseEntityService<IAnimalRepository, IAppUnitOfWork, Animal, Animal>, IAnimalService
public class AnimalService : BaseEntityService<IAnimalRepository, IAppUnitOfWork, DAL.App.DTO.Animal, Animal>, IAnimalService
{
public AnimalService(IAppUnitOfWork unitOfWork)
: base(unitOfWork, new IdentityMapper<Animal, Animal>(), unitOfWork.Animals)
: base(unitOfWork, new BaseBLLMapper<DAL.App.DTO.Animal, Animal>(), unitOfWork.Animals)
{
}
}
......
using BLL.App.DTO;
using BLL.Base.Mappers;
using BLL.Base.Services;
using Contracts.BLL.App.Services;
using Contracts.BLL.Base.Mappers;
using Contracts.DAL.App;
using Contracts.DAL.App.Repositories;
using Contracts.DAL.Base.Repositories;
using DAL.App.EF;
using Domain;
namespace BLL.App.Services
{
public class OwnerAnimalService : BaseEntityService<IOwnerAnimalRepository, IAppUnitOfWork, OwnerAnimal, OwnerAnimal>, IOwnerAnimalService
public class OwnerAnimalService : BaseEntityService<IOwnerAnimalRepository, IAppUnitOfWork, DAL.App.DTO.OwnerAnimal, OwnerAnimal>, IOwnerAnimalService
{
public OwnerAnimalService(IAppUnitOfWork unitOfWork)
: base(unitOfWork, new IdentityMapper<OwnerAnimal, OwnerAnimal>(), unitOfWork.OwnerAnimals)
: base(unitOfWork, new BaseBLLMapper<DAL.App.DTO.OwnerAnimal, OwnerAnimal>(), unitOfWork.OwnerAnimals)
{
}
}
......
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using BLL.Base.Mappers;
using BLL.Base.Services;
......@@ -11,24 +12,22 @@ using Contracts.DAL.App.Repositories;
using Contracts.DAL.Base;
using Contracts.DAL.Base.Repositories;
using DAL.App.EF;
using Domain;
using PublicApi.DTO.v1;
namespace BLL.App.Services
{
public class OwnerService : BaseEntityService<IOwnerRepository, IAppUnitOfWork, Owner, Owner>, IOwnerService
public class OwnerService : BaseEntityService<IOwnerRepository, IAppUnitOfWork, DAL.App.DTO.Owner, BLL.App.DTO.Owner>, IOwnerService
{
public OwnerService(IAppUnitOfWork unitOfWork)
: base(unitOfWork, new IdentityMapper<Owner, Owner>(), unitOfWork.Owners)
: base(unitOfWork, new BaseBLLMapper<DAL.App.DTO.Owner, BLL.App.DTO.Owner>(), unitOfWork.Owners)
{
}
public async Task<IEnumerable<Owner>> AllAsync(Guid? userId = null) =>
await ServiceRepository.AllAsync(userId);
public async Task<IEnumerable<BLL.App.DTO.Owner>> AllAsync(Guid? userId = null) =>
(await ServiceRepository.AllAsync(userId)).Select( dalEntity => Mapper.Map(dalEntity) );
public async Task<Owner> FirstOrDefaultAsync(Guid id, Guid? userId = null) =>
await ServiceRepository.FirstOrDefaultAsync(id, userId);
public async Task<BLL.App.DTO.Owner> FirstOrDefaultAsync(Guid id, Guid? userId = null) =>
Mapper.Map(await ServiceRepository.FirstOrDefaultAsync(id, userId));
public async Task<bool> ExistsAsync(Guid id, Guid? userId = null) =>
await ServiceRepository.ExistsAsync(id, userId);
......@@ -36,10 +35,12 @@ namespace BLL.App.Services
public async Task DeleteAsync(Guid id, Guid? userId = null) =>
await ServiceRepository.DeleteAsync(id, userId);
/*
public async Task<IEnumerable<OwnerDTO>> DTOAllAsync(Guid? userId = null) =>
await ServiceRepository.DTOAllAsync(userId);
public async Task<OwnerDTO> DTOFirstOrDefaultAsync(Guid id, Guid? userId = null) =>
await ServiceRepository.DTOFirstOrDefaultAsync(id, userId);
*/
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ using Contracts.BLL.Base.Mappers;
namespace BLL.Base.Mappers
{
public class BaseBLLMapper<TInObject, TOutObject> : IBaseBLLMapper<TInObject, TOutObject>
where TInObject : class, new()
where TInObject : class, new()
where TOutObject : class, new()
{
......@@ -18,11 +18,17 @@ namespace BLL.Base.Mappers
config.CreateMap<TOutObject, TInObject>();
}).CreateMapper();
}
public TOutObject Map<TInObject, TOutObject>(TInObject inObject)
where TInObject : class, new()
where TOutObject : class, new()
public TOutObject Map(TInObject inObject)
{
return _mapper.Map<TInObject, TOutObject>(inObject);
}
public TMapOutObject Map<TMapInObject, TMapOutObject>(TMapInObject inObject)
where TMapInObject : class, new()
where TMapOutObject : class, new()
{
return _mapper.Map<TMapInObject, TMapOutObject>(inObject);
}
}
}
\ No newline at end of file
......@@ -6,11 +6,16 @@ namespace BLL.Base.Mappers
where TInObject : class, new()
where TOutObject : class, new()
{
public TOutObject Map<TInObject, TOutObject>(TInObject inObject)
where TInObject : class, new()
where TOutObject : class, new()
public TOutObject Map(TInObject inObject)
{
return inObject as TOutObject;
return inObject as TOutObject ?? default!;
}
public TMapOutObject Map<TMapInObject, TMapOutObject>(TMapInObject inObject)
where TMapInObject : class, new()
where TMapOutObject : class, new()
{
return inObject as TMapOutObject ?? default!;
}
}
}
\ No newline at end of file
......@@ -11,13 +11,13 @@ namespace BLL.Base.Services
{
public class BaseEntityService<TServiceRepository, TUnitOfWork, TDALEntity, TBLLEntity> : BaseService,
IBaseEntityService<TBLLEntity>
where TBLLEntity : class, IDomainEntity<Guid>, new()
where TDALEntity : class, IDomainEntity<Guid>, new()
where TBLLEntity : class, IDomainBaseEntity<Guid>, new()
where TDALEntity : class, IDomainBaseEntity<Guid>, new()
where TUnitOfWork : IBaseUnitOfWork
where TServiceRepository : IBaseRepository<TDALEntity>
{
protected readonly TUnitOfWork ServiceUnitOfWork;
private readonly IBaseBLLMapper<TDALEntity, TBLLEntity> _mapper;
protected readonly IBaseBLLMapper<TDALEntity, TBLLEntity> Mapper;
protected readonly TServiceRepository ServiceRepository;
public BaseEntityService(TUnitOfWork unitOfWork, IBaseBLLMapper<TDALEntity, TBLLEntity> mapper,
......@@ -25,7 +25,7 @@ namespace BLL.Base.Services
{
ServiceUnitOfWork = unitOfWork;
ServiceRepository = serviceRepository;
_mapper = mapper;
Mapper = mapper;
// TODO - NOT POSSIBLE - we have no idea of what DAL actually is.
// we have now BaseRepository implementation - cant call new on it
......@@ -35,29 +35,29 @@ namespace BLL.Base.Services
public virtual IEnumerable<TBLLEntity> All() =>
ServiceRepository.All().Select(entity => _mapper.Map<TDALEntity, TBLLEntity>(entity));
ServiceRepository.All().Select(entity => Mapper.Map<TDALEntity, TBLLEntity>(entity));
public virtual async Task<IEnumerable<TBLLEntity>> AllAsync() =>
(await ServiceRepository.AllAsync()).Select(entity => _mapper.Map<TDALEntity, TBLLEntity>(entity));
(await ServiceRepository.AllAsync()).Select(entity => Mapper.Map<TDALEntity, TBLLEntity>(entity));
public virtual TBLLEntity Find(params object[] id) =>
_mapper.Map<TDALEntity, TBLLEntity>(ServiceRepository.Find(id));
Mapper.Map<TDALEntity, TBLLEntity>(ServiceRepository.Find(id));
public virtual async Task<TBLLEntity> FindAsync(params object[] id) =>
_mapper.Map<TDALEntity, TBLLEntity>(await ServiceRepository.FindAsync(id));
Mapper.Map<TDALEntity, TBLLEntity>(await ServiceRepository.FindAsync(id));
public virtual TBLLEntity Add(TBLLEntity entity) =>
_mapper.Map<TDALEntity, TBLLEntity>(ServiceRepository.Add(_mapper.Map<TBLLEntity, TDALEntity>(entity)));
Mapper.Map<TDALEntity, TBLLEntity>(ServiceRepository.Add(Mapper.Map<TBLLEntity, TDALEntity>(entity)));
public virtual TBLLEntity Update(TBLLEntity entity) =>
_mapper.Map<TDALEntity, TBLLEntity>(ServiceRepository.Update(_mapper.Map<TBLLEntity, TDALEntity>(entity)));
Mapper.Map<TDALEntity, TBLLEntity>(ServiceRepository.Update(Mapper.Map<TBLLEntity, TDALEntity>(entity)));
public virtual TBLLEntity Remove(TBLLEntity entity) =>
_mapper.Map<TDALEntity, TBLLEntity>(ServiceRepository.Remove(_mapper.Map<TBLLEntity, TDALEntity>(entity)));
Mapper.Map<TDALEntity, TBLLEntity>(ServiceRepository.Remove(Mapper.Map<TBLLEntity, TDALEntity>(entity)));
public virtual TBLLEntity Remove(params object[] id) =>
_mapper.Map<TDALEntity, TBLLEntity>(ServiceRepository.Remove(id));
Mapper.Map<TDALEntity, TBLLEntity>(ServiceRepository.Remove(id));
}
}
\ No newline at end of file
......@@ -5,9 +5,9 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\BLL.App.DTO\BLL.App.DTO.csproj" />
<ProjectReference Include="..\Contracts.BLL.Base\Contracts.BLL.Base.csproj" />
<ProjectReference Include="..\Contracts.DAL.App\Contracts.DAL.App.csproj" />
<ProjectReference Include="..\Domain\Domain.csproj" />
</ItemGroup>
</Project>
using BLL.App.DTO;
using Contracts.BLL.Base.Services;
using Contracts.DAL.Base.Repositories;
using Domain;
namespace Contracts.BLL.App.Services
{
......
using System;
using BLL.App.DTO;
using Contracts.BLL.Base.Services;
using Domain;
namespace Contracts.BLL.App.Services
{
......
using Contracts.BLL.Base.Services;
using System;
using BLL.App.DTO;
using Contracts.DAL.App.Repositories;
using Domain;
namespace Contracts.BLL.App.Services
{
public interface IOwnerService: IOwnerRepository
public interface IOwnerService: IOwnerRepository<Guid, Owner>
{
}
......
......@@ -4,11 +4,10 @@ namespace Contracts.BLL.Base.Mappers
where TOutObject : class, new()
where TInObject : class, new()
{
TOutObject Map<TInObject, TOutObject>(TInObject inObject)
where TOutObject : class, new()
where TInObject : class, new();
TOutObject Map(TInObject inObject);
TMapOutObject Map<TMapInObject, TMapOutObject>(TMapInObject inObject)
where TMapOutObject : class, new()
where TMapInObject : class, new();
}
}
\ No newline at end of file
......@@ -9,9 +9,10 @@ namespace Contracts.BLL.Base.Services
// add common base methods here
}
public interface IBaseEntityService<TBLLEntity> : IBaseService, IBaseRepository<TBLLEntity>
where TBLLEntity : class, IDomainEntity<Guid>, new()
public interface IBaseEntityService<TBLLEntity> : IBaseService, IBaseRepository<Guid, TBLLEntity>
where TBLLEntity : class, IDomainBaseEntity<Guid>, new()
{
}
}
\ No newline at end of file
......@@ -6,8 +6,7 @@
<ItemGroup>
<ProjectReference Include="..\Contracts.DAL.Base\Contracts.DAL.Base.csproj" />
<ProjectReference Include="..\Domain\Domain.csproj" />
<ProjectReference Include="..\PublicApi.DTO.v1\PublicApi.DTO.v1.csproj" />
<ProjectReference Include="..\DAL.App.DTO\DAL.App.DTO.csproj" />
</ItemGroup>
</Project>
using Contracts.DAL.App.Repositories;
using Contracts.DAL.Base;
using Contracts.DAL.Base.Repositories;
using Domain;
namespace Contracts.DAL.App
{
......
......@@ -2,8 +2,7 @@ using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Contracts.DAL.Base.Repositories;
using Domain;
using PublicApi.DTO.v1;
using DAL.App.DTO;
namespace Contracts.DAL.App.Repositories
{
......@@ -15,8 +14,10 @@ namespace Contracts.DAL.App.Repositories
Task<bool> ExistsAsync(Guid id, Guid? userId = null);
Task DeleteAsync(Guid id, Guid? userId = null);
/*
// DTO methods
Task<IEnumerable<AnimalDTO>> DTOAllAsync(Guid? userId = null);
Task<AnimalDTO> DTOFirstOrDefaultAsync(Guid id, Guid? userId = null);
*/
}
}
\ No newline at end of file
......@@ -2,8 +2,7 @@ using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Contracts.DAL.Base.Repositories;
using Domain;
using PublicApi.DTO.v1;
using DAL.App.DTO;
namespace Contracts.DAL.App.Repositories
{
......@@ -15,9 +14,11 @@ namespace Contracts.DAL.App.Repositories
Task<bool> ExistsAsync(Guid id, Guid? userId = null);
Task DeleteAsync(Guid id, Guid? userId = null);
/*
// DTO methods
Task<IEnumerable<OwnerAnimalDTO>> DTOAllAsync(Guid? userId = null);
Task<OwnerAnimalDTO> DTOFirstOrDefaultAsync(Guid id, Guid? userId = null);
*/
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Contracts.DAL.Base;
using Contracts.DAL.Base.Repositories;
using Domain;
using PublicApi.DTO.v1;
using DAL.App.DTO;
namespace Contracts.DAL.App.Repositories
{
public interface IOwnerRepository : IBaseRepository<Owner>
public interface IOwnerRepository : IOwnerRepository<Guid, Owner>, IBaseRepository<Owner>
{
Task<IEnumerable<Owner>> AllAsync(Guid? userId = null);
Task<Owner> FirstOrDefaultAsync(Guid id, Guid? userId = null);
}
public interface IOwnerRepository<TKey, TDALEntity> : IBaseRepository<TKey,TDALEntity>
where TDALEntity : class, IDomainBaseEntity<TKey>, new()
where TKey : IEquatable<TKey>
{
Task<IEnumerable<TDALEntity>> AllAsync(Guid? userId = null);
Task<TDALEntity> FirstOrDefaultAsync(Guid id, Guid? userId = null);
Task<bool> ExistsAsync(Guid id, Guid? userId = null);
Task DeleteAsync(Guid id, Guid? userId = null);
// DTO methods
Task<IEnumerable<OwnerDTO>> DTOAllAsync(Guid? userId = null);
Task<OwnerDTO> DTOFirstOrDefaultAsync(Guid id, Guid? userId = null);
//Task<IEnumerable<OwnerDTO>> DTOAllAsync(Guid? userId = null);
//Task<OwnerDTO> DTOFirstOrDefaultAsync(Guid id, Guid? userId = null);
}
}
\ No newline at end of file
......@@ -4,4 +4,8 @@
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="3.1.3" />
</ItemGroup>
</Project>
......@@ -7,7 +7,7 @@ namespace Contracts.DAL.Base
}
public interface IDomainBaseEntity<TKey>
where TKey : struct, IEquatable<TKey>
where TKey : IEquatable<TKey>
{
public TKey Id { get; set; }
}
......
using System;
namespace Contracts.DAL.Base
{
public interface IDomainEntity : IDomainEntity<Guid>
{
}
public interface IDomainEntity<TKey> : IDomainBaseEntity<TKey>, IDomainEntityMetadata
where TKey : struct, IEquatable<TKey>
{
}
}
\ No newline at end of file
using System;
namespace Contracts.DAL.Base
{
public interface IDomainEntityBaseMetadata : IDomainEntityBaseMetadata<Guid>
{
}
public interface IDomainEntityBaseMetadata<TKey> : IDomainBaseEntity<TKey>, IDomainEntityMetadata
where TKey : IEquatable<TKey>
{
}
}
\ No newline at end of file
using System;
using Microsoft.AspNetCore.Identity;
namespace Contracts.DAL.Base
{
public interface IDomainEntityUser<TUser> : IDomainEntityUser<Guid, TUser>
where TUser : IdentityUser<Guid>
{
}
public interface IDomainEntityUser<TKey, TUser>
where TKey : IEquatable<TKey>
where TUser : IdentityUser<TKey>
{
public TKey AppUserId { get; set; }