30 lines
860 B
C#
30 lines
860 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using System;
|
|
using RMuseum.Models.Ganjoor;
|
|
using System.Threading.Tasks;
|
|
using RSecurityBackend.Models.Generic;
|
|
|
|
namespace RMuseum.Services.Implementation
|
|
{
|
|
/// <summary>
|
|
/// IGanjoorService implementation
|
|
/// </summary>
|
|
public partial class GanjoorService : IGanjoorService
|
|
{
|
|
/// <summary>
|
|
/// tajik poets
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public async Task<RServiceResult<GanjoorTajikPoet[]>> GetTajikPoetsAsync()
|
|
{
|
|
try
|
|
{
|
|
return new RServiceResult<GanjoorTajikPoet[]>(await _context.TajikPoets.AsNoTracking().ToArrayAsync());
|
|
}
|
|
catch (Exception exp)
|
|
{
|
|
return new RServiceResult<GanjoorTajikPoet[]>(null, exp.ToString());
|
|
}
|
|
}
|
|
}
|
|
} |