Hi, I made this AppService, having a get function, but when i test the service from Swagger the input Id paramter is always null. please why is that happening?
below is an example
//input dto
public class GetRuleInput
{
public string Id { get; set; }
}
//interface
public interface ILoyaltyAppService : IApplicationService
{
Task<JObject> GetRule(GetRuleInput input);
}
//service
public async Task<JObject> GetRule(GetRuleInput input) {
var result = await _maClient.GetSingleRuleAsync(input.Id);
var response = JObject.FromObject(result);
return response;
}
Hi, I followed the instructions on how to create a custom repository( <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/EntityFramework-Integration#DocCustomRepositoryMethods">http://www.aspnetboilerplate.com/Pages/ ... oryMethods</a> ). My assumption with dependency injection i will be able to access the new repository in my application service. But i am unable to acces it. I am not quite sure what i am doing wrong. please how can I make this work?
here is how created the custom repository namespace Example.EntityFramework.Repositories { public interface IPotalRepository : IRepository<EventLiveFeeds>, ITransientDependency { List<EventLiveFeeds> GetEventFeeds(int tenantId); }
public class PortalRepository : ExampleRepositoryBase<EventLiveFeeds>, IPortalRepository
{
public PortalRepository(IDbContextProvider<ExempleDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public List<EventLiveFeeds> GetEventFeeds(int tenantId )
{
var query = "select * from[dbo].[vw_Portal_EventLiveFeeds]";
var ret = Context.Database.SqlQuery<EventLiveFeeds>(query).ToList();
return ret;
}
}
}
here is the application service class
namespace Example.Tenants.Dashboard { [AbpAuthorize(AppPermissions.Pages_Tenant_Dashboard)] public class TenantDashboardAppService : Butiqs_PortalAppServiceBase, ITenantDashboardAppService {
private readonly IPortalRepository<EventLiveFeeds> _eventLiveFeeds;
public TenantDashboardAppService( IRepository<EventLiveFeeds> eventLiveFeeds)
{
_eventLiveFeeds = eventLiveFeeds;
}
public ListResultOutput<EventLiveFeeds> GetEventLiveFeeds()
{
var events = _eventLiveFeeds
.GetAll()
.ToList();
return new ListResultOutput<EventLiveFeeds>(events.MapTo<List<EventLiveFeeds>>());
}
}
}
kind regards