Finally got the api working properly
This commit is contained in:
@@ -11,7 +11,6 @@ namespace Emergence.services.Extensions
|
||||
{
|
||||
public static IServiceCollection AddEmergenceServices(this IServiceCollection services)
|
||||
{
|
||||
services = services.AddTransient<IUserService, UserService>();
|
||||
services = services.AddTransient<ITenantService, TenantService>();
|
||||
|
||||
return services;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Emergence.services.Interface
|
||||
{
|
||||
public interface IService<T, I> where T : class
|
||||
{
|
||||
public Task<IList<T>> GetAllAsync();
|
||||
public Task<IEnumerable<T>> GetAllAsync();
|
||||
public Task<T> GetByIdAsync(I id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,13 @@ namespace Emergence.services.Services;
|
||||
public class TenantService : ITenantService
|
||||
{
|
||||
private List<TenantModel> testList = [
|
||||
new TenantModel {TenantCode = "FJP", CompanyName ="Fred J Potter" },
|
||||
new TenantModel {TenantCode = "JAZZ", CompanyName ="Jazzbond" },
|
||||
new TenantModel {TenantCode = "TDT", CompanyName ="The Digital Tailor" },
|
||||
new TenantModel {TenantCode = "HBAS", CompanyName ="Hicks Building and Asbestos Services" },
|
||||
new TenantModel {Id = Guid.NewGuid(), TenantCode = "FJP", CompanyName = "Fred J Potter", IsInactive = false },
|
||||
new TenantModel {Id = Guid.NewGuid(), TenantCode = "JAZZ", CompanyName = "Jazzbond", IsInactive = false },
|
||||
new TenantModel {Id = Guid.NewGuid(), TenantCode = "TDT", CompanyName = "The Digital Tailor", IsInactive = false },
|
||||
new TenantModel {Id = Guid.NewGuid(), TenantCode = "HBAS", CompanyName = "Hicks Building and Asbestos Services", IsInactive = false },
|
||||
];
|
||||
|
||||
public async Task<IList<TenantModel>> GetAllAsync()
|
||||
public async Task<IEnumerable<TenantModel>> GetAllAsync()
|
||||
{
|
||||
return testList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user