Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "faweh"

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&lt;EventLiveFeeds&gt;, IPortalRepository
{
    public PortalRepository(IDbContextProvider&lt;ExempleDbContext&gt; dbContextProvider)
        : base(dbContextProvider)
    {
    }

    public List&lt;EventLiveFeeds&gt; GetEventFeeds(int tenantId )
    {
        var query = "select * from[dbo].[vw_Portal_EventLiveFeeds]";
        var ret = Context.Database.SqlQuery&lt;EventLiveFeeds&gt;(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&lt;EventLiveFeeds&gt; _eventLiveFeeds;

    public TenantDashboardAppService( IRepository&lt;EventLiveFeeds&gt; eventLiveFeeds)
    {
        _eventLiveFeeds = eventLiveFeeds;

    }


    public ListResultOutput&lt;EventLiveFeeds&gt; GetEventLiveFeeds()
    {
        var events = _eventLiveFeeds
                       .GetAll()
                       .ToList();

        return new ListResultOutput&lt;EventLiveFeeds&gt;(events.MapTo&lt;List&lt;EventLiveFeeds&gt;>());

    }
}

}

kind regards

Showing 1 to 2 of 2 entries