last prepare and Fixes on XWebinar Service ...
This commit is contained in:
@@ -192,6 +192,33 @@ namespace xWebinarService.Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve all Exists Webinar Ids ...
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("Ids")]
|
||||||
|
public virtual async Task<ActionResult<IEnumerable<Guid>>> GetWebinarIds()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Do ...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = await WebinarProvider
|
||||||
|
.GetWebinarIds();
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.
|
||||||
|
ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Query Webinars ...
|
/// Query Webinars ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -222,6 +249,36 @@ namespace xWebinarService.Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query Webinar Ids ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("QueryIds")]
|
||||||
|
public virtual async Task<ActionResult<XQueryResult<Guid>>> QueryWebinarIds(
|
||||||
|
[FromQuery] XQuery query
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Do ...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = await WebinarProvider
|
||||||
|
.QueryWebinarIds(query);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.
|
||||||
|
ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove Specified Webinar ...
|
/// Remove Specified Webinar ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -63,6 +63,12 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<XWebinarDto> GetWebinar(Guid id);
|
Task<XWebinarDto> GetWebinar(Guid id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve all Exists Webinar Ids ...
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<IEnumerable<Guid>> GetWebinarIds();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieve all Exists Webinars ...
|
/// Retrieve all Exists Webinars ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -76,6 +82,13 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<XQueryResult<XWebinarDto>> QueryWebinars(XQuery query);
|
Task<XQueryResult<XWebinarDto>> QueryWebinars(XQuery query);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query Webinar Ids ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<XQueryResult<Guid>> QueryWebinarIds(XQuery query);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove Specified Webinar ...
|
/// Remove Specified Webinar ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -41,6 +41,12 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ActionResult<IEnumerable<XWebinarDto>>> GetWebinars();
|
Task<ActionResult<IEnumerable<XWebinarDto>>> GetWebinars();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve all Exists Webinar Ids ...
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ActionResult<IEnumerable<Guid>>> GetWebinarIds();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Query Webinars ...
|
/// Query Webinars ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -48,6 +54,13 @@ namespace xWebinarService.Interfaces
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ActionResult<XQueryResult<XWebinarDto>>> QueryWebinars([FromQuery] XQuery query);
|
Task<ActionResult<XQueryResult<XWebinarDto>>> QueryWebinars([FromQuery] XQuery query);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query Webinar Ids ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ActionResult<XQueryResult<Guid>>> QueryWebinarIds([FromQuery] XQuery query);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove Specified Webinar ...
|
/// Remove Specified Webinar ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -391,14 +391,14 @@ namespace xWebinarService.Providers
|
|||||||
// Title ...
|
// Title ...
|
||||||
var titleAddedLocales = await TitleResourceProvider.AddOrUpdate(
|
var titleAddedLocales = await TitleResourceProvider.AddOrUpdate(
|
||||||
resource: entity.Title,
|
resource: entity.Title,
|
||||||
locales: entityDto.Title.Locales
|
locales: item.Title.Locales
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Description ...
|
// Description ...
|
||||||
var descriptionAddedLocales = await DescriptionResourceProvider.AddOrUpdate(
|
var descriptionAddedLocales = await DescriptionResourceProvider.AddOrUpdate(
|
||||||
resource: entity.Description,
|
resource: entity.Description,
|
||||||
locales: entityDto.Description.Locales
|
locales: item.Description.Locales
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -441,6 +441,19 @@ namespace xWebinarService.Providers
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve all Exists Webinar Ids ...
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<IEnumerable<Guid>> GetWebinarIds()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = await WebinarRepository.AsQueryable().SelectAsync(async l => l.Id);
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Query Webinars ...
|
/// Query Webinars ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -518,6 +531,75 @@ namespace xWebinarService.Providers
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query Webinar Ids ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<XQueryResult<Guid>> QueryWebinarIds(XQuery query)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (query.IsNull())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Normalize ...
|
||||||
|
query = query.NormalizeQuery(DataSercviceConfiguration);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Since in Resourceable Entities we have to Search on Locales
|
||||||
|
// we Must Implement Senario Custom ...
|
||||||
|
var items = await GetWebinarIds();
|
||||||
|
var totalItemsCount = items.Count();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Apply Filter ...
|
||||||
|
if (!query.Filter.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
items = items
|
||||||
|
.Where(i => i.ToString().ToNormalString().Contains(query.Filter));
|
||||||
|
}
|
||||||
|
int filteredItemsCount = items.Count();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Count Pages ...
|
||||||
|
var totalPagesCount = query.CountPages(totalItemsCount);
|
||||||
|
var filteredPagesCount = query.CountPages(filteredItemsCount);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Apply Paging and Sorting ...
|
||||||
|
if (totalItemsCount > 0 &&
|
||||||
|
filteredItemsCount > 0)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Apply Paging ...
|
||||||
|
items = items.ApplyPaging(
|
||||||
|
query.Page,
|
||||||
|
query.PageSize
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Prepare Result ...
|
||||||
|
var result = new XQueryResult<Guid>
|
||||||
|
{
|
||||||
|
Items = items,
|
||||||
|
Page = query.Page,
|
||||||
|
PageSize = query.PageSize,
|
||||||
|
TotalPages = totalPagesCount,
|
||||||
|
TotalItems = totalItemsCount,
|
||||||
|
TotalFilteredPages = filteredPagesCount,
|
||||||
|
TotalFilteredItems = filteredItemsCount
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove Specified Webinar ...
|
/// Remove Specified Webinar ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user