last ...
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
using xPushService.Interfaces;
|
||||
using xTagService.Models.Dtos;
|
||||
using xTagService.Models.Entities;
|
||||
|
||||
namespace xTagService.Interfaces.Dtos
|
||||
{
|
||||
public interface IXTagDtoHub : IXBaseDtoHub<XTag, XTagDto, int>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xDataService.Interfaces;
|
||||
using xTagService.Models.Dtos;
|
||||
using xTagService.Models.Entities;
|
||||
|
||||
namespace xTagService.Interfaces.Dtos
|
||||
{
|
||||
public interface IXTagRepositoryService : IXBaseRepositoryService<XTag, XTagDto, int>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using xPushService.Interfaces;
|
||||
using xTagService.Models.Dtos;
|
||||
using xTagService.Models.Entities;
|
||||
using xTagService.Providers.Dtos;
|
||||
|
||||
namespace xTagService.Interfaces.Dtos
|
||||
{
|
||||
public interface IXTagServiceProvider : IXBaseDtoProvider<XTag, XTagDto, int, XTagDtoHub>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using xPushService.Interfaces;
|
||||
using xTagService.Models.Entities;
|
||||
|
||||
namespace xTagService.Interfaces.Entities
|
||||
{
|
||||
public interface IXTagEntityHub : IXBaseEntityHub<XTag, int>
|
||||
{ }
|
||||
}
|
||||
@@ -3,6 +3,6 @@ using xTagService.Models.Entities;
|
||||
|
||||
namespace xTagService.Interfaces.Entities
|
||||
{
|
||||
public interface IXTagEvents: IXBaseRepositoryEvents<XTag>
|
||||
public interface IXTagKeyGenerator : IXKeyGenerator<XTag, int>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using xDataService.Interfaces;
|
||||
using xTagService.Models.Entities;
|
||||
|
||||
namespace xTagService.Interfaces.Entities
|
||||
{
|
||||
public interface IXTagRepositoryEvents : IXBaseRepositoryEvents<XTag>
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using xPushService.Interfaces;
|
||||
using xTagService.Models.Entities;
|
||||
using xTagService.Providers.Entities;
|
||||
|
||||
namespace xTagService.Interfaces.Entities
|
||||
{
|
||||
public interface IXTagRepositoryProvider : IXBaseEntityProvider<XTag, int, XTagEntityHub>
|
||||
{ }
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using xDataService.Interfaces;
|
||||
using xDataService.Models;
|
||||
@@ -5,20 +6,8 @@ using xTagService.Models.Dtos;
|
||||
|
||||
namespace xTagService.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Implementing XBaseTagProvider ...
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey"></typeparam>
|
||||
public interface IXBaseTagProvider<TKey> : IXBaseReferencedProvider<XTagDto, TKey>
|
||||
{
|
||||
//
|
||||
#region Props ...
|
||||
/// <summary>
|
||||
/// Provider Identifier ...
|
||||
/// </summary>
|
||||
IXTagProvider TagProvider { get; }
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Tools ...
|
||||
/// <summary>
|
||||
@@ -27,11 +16,13 @@ namespace xTagService.Interfaces
|
||||
/// <param name="tag"></param>
|
||||
/// <param name="providedForId"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> AddReference(
|
||||
string tag,
|
||||
TKey providedForId,
|
||||
string connectionId = null
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
@@ -40,11 +31,13 @@ namespace xTagService.Interfaces
|
||||
/// <param name="tag"></param>
|
||||
/// <param name="reference"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> AddReference(
|
||||
string tag,
|
||||
XReference<TKey> reference,
|
||||
string connectionId = null
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
@@ -53,25 +46,29 @@ namespace xTagService.Interfaces
|
||||
/// <param name="tag"></param>
|
||||
/// <param name="providedForId"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> RemoveReference(
|
||||
string tag,
|
||||
TKey providedForId,
|
||||
string connectionId = null
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Remove Reference a Tag for Specific XRefence<TKey> ...
|
||||
/// </summary>
|
||||
/// <param name="tag"></param>
|
||||
/// <param name="providedForId"></param>
|
||||
/// <param name="reference"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> RemoveReference(
|
||||
string tag,
|
||||
XReference<TKey> reference,
|
||||
string connectionId = null
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using xDataService.Configuration;
|
||||
using xIdentityService.Interfaces;
|
||||
using xModels.Dtos;
|
||||
using xTagService.Hubs;
|
||||
using xTagService.Interfaces.Entities;
|
||||
using xTagService.Models.Dtos;
|
||||
using xTagService.Models.Entities;
|
||||
|
||||
namespace xTagService.Interfaces
|
||||
{
|
||||
public interface IXTagProvider
|
||||
{
|
||||
//
|
||||
#region Props ...
|
||||
IXTagRepository Repository { get; }
|
||||
IHubContext<XTagEntityHub> Hub { get; }
|
||||
IXIdentityProvider IdentityProvider { get; }
|
||||
XDataServiceConfiguration DataConfiguration { get; }
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Helpers ...
|
||||
/// <summary>
|
||||
/// Converts an Entity to Dto ...
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
XTagDto ToDto(XTag model);
|
||||
|
||||
/// <summary>
|
||||
/// Converts a List of Entitiies to List of Dto's ...
|
||||
/// </summary>
|
||||
/// <param name="models"></param>
|
||||
/// <returns></returns>
|
||||
IEnumerable<XTagDto> ToDtoList(IEnumerable<XTag> models);
|
||||
|
||||
/// <summary>
|
||||
/// Converts Query Result of Entities to Dto ...
|
||||
/// </summary>
|
||||
/// <param name="queryResult"></param>
|
||||
/// <returns></returns>
|
||||
XQueryResult<XTagDto> ToDtoQueryResult(XQueryResult<XTag> queryResult);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Tools ...
|
||||
/// <summary>
|
||||
/// Add Specified Tag ...
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XTagDto> Add(
|
||||
XTagDto model,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Update Specified Dto ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <returns></returns>
|
||||
Task<XTagDto> Update(
|
||||
int id,
|
||||
XTagDto model,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Remove Specified Dto ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <returns></returns>
|
||||
Task<XTagDto> Remove(
|
||||
int id,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Specified Item as Dto ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<XTagDto> Get(
|
||||
int id,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Specified Tag by it's Label ...
|
||||
/// </summary>
|
||||
/// <param name="tag"></param>
|
||||
/// <returns></returns>
|
||||
Task<XTagDto> GetTag(
|
||||
string tag,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve All Items as Dto ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XTagDto>> GetAll(
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Find Specified Item by Condition ...
|
||||
/// </summary>
|
||||
/// <param name="whereClause"></param>
|
||||
/// <returns></returns>
|
||||
Task<XTagDto> FindOne(
|
||||
Expression<Func<XTag, bool>> whereClause,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Find Many Items based on Conditions ...
|
||||
/// </summary>
|
||||
/// <param name="whereClause"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XTagDto>> FindMany(
|
||||
Expression<Func<XTag, bool>> whereClause,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Query Model retrieving Dtos ...
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <returns></returns>
|
||||
Task<XQueryResult<XTagDto>> Query(
|
||||
XQuery query,
|
||||
Expression<Func<XTag, bool>> whereClause = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Count Exists Entities ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<int> Count();
|
||||
|
||||
/// <summary>
|
||||
/// Check Entity Exists or not ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> IsExists(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Check Tag Exists by Label ...
|
||||
/// </summary>
|
||||
/// <param name="tag"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> IsTagExists(string tag);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using xDataService.Interfaces;
|
||||
using xTagService.Models.Entities;
|
||||
|
||||
namespace xTagService.Interfaces
|
||||
{
|
||||
public interface IXTagSeeder : IXBaseDbSeeder<XTag, int>
|
||||
{ }
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using xModels.Dtos;
|
||||
using xTagService.Models.Dtos;
|
||||
|
||||
namespace xTagService.Interfaces
|
||||
{
|
||||
public interface IXTagServiceControllerActions
|
||||
{
|
||||
//
|
||||
#region Actions ...
|
||||
/// <summary>
|
||||
/// Add Tag by Providing Dto ...
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
Task<ActionResult<XTagDto>> Add(
|
||||
[FromBody] XTagDto model
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Specified Tag Dto by ID ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<ActionResult<XTagDto>> Get(
|
||||
[FromRoute ]int id
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Specified Tag Dto by it's Label ...
|
||||
/// </summary>
|
||||
/// <param name="tag"></param>
|
||||
/// <returns></returns>
|
||||
Task<ActionResult<XTagDto>> GetTag(
|
||||
[FromQuery] string tag
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve All Exists Tags ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<ActionResult<IEnumerable<XTagDto>>> GetAll();
|
||||
|
||||
/// <summary>
|
||||
/// Search For Specified Tag by Providing a query on Label ...
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <returns></returns>
|
||||
Task<ActionResult<XTagDto>> FindOne(
|
||||
[FromQuery] string query
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Search For Specified Tags By Providing Query on Labels ...
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <returns></returns>
|
||||
Task<ActionResult<IEnumerable<XTagDto>>> FindMany(
|
||||
[FromQuery] string query
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Tags based on Query Model ...
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <returns></returns>
|
||||
Task<ActionResult<XQueryResult<XTagDto>>> Query(
|
||||
[FromQuery] XQuery query
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Update Specified Tag ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
Task<ActionResult<XTagDto>> Update(
|
||||
[FromRoute] int id,
|
||||
[FromBody] XTagDto model
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Remove Specified Tag by ID ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<ActionResult<XTagDto>> Remove(
|
||||
[FromRoute] int id
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Count Exists Tags ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<ActionResult<int>> Count();
|
||||
|
||||
/// <summary>
|
||||
/// Check Tag Exists by ID ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<ActionResult<bool>> IsExists(
|
||||
[FromRoute] int id
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Check Tag Exists by Providing Label ...
|
||||
/// </summary>
|
||||
/// <param name="tag"></param>
|
||||
/// <returns></returns>
|
||||
Task<ActionResult<bool>> IsTagExists(
|
||||
[FromQuery]string tag
|
||||
);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user