Base solution for your next web application

Activities of "george"

<cite>ismcagdas: </cite>

By the way, Metronic theme already has a calendar in it called fullCalendar. You can also use it if you like. FullCalendar github page: <a class="postlink" href="https://github.com/fullcalendar/fullcalendar">https://github.com/fullcalendar/fullcalendar</a> FullCalendar Metronic sample: <a class="postlink" href="http://keenthemes.com/preview/metronic/theme/admin_4_material_design/app_calendar.html">http://keenthemes.com/preview/metronic/ ... endar.html</a>

Hi, that was a useful information. I like the fullCalendar and I'm going to use that. Thank you :D

<cite>ismcagdas: </cite> Hi,

Probably IRepository<Subject> is not created by Dependency Injection. The reason might be Subject entity is not added to any DbContext.

If it is added to any dbContext, do you have below line in that module's Initialize method (one of your EntityFramework modules).

IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());

Oh my god! Thank You very much. Exactly this was the problem..! I didn't added the Subject entity to the DbContext. Now it's working well.. Thanks a lot and sorry for the foolish mistake I've done!

Hi,

Thank you very much for the information. I used the code given below:

In Smart_campusWebApiModule

Configuration.Modules.AbpWebApi().DynamicApiControllerBuilder
                .ForAll<IApplicationService>(typeof(Smart_campusBaseModuleApplicationModule).Assembly, "app")
                .Build();

Now the AppServices of Smart_campusBaseModuleApplicationModule are generated and I can call the AppService methods in the API.

But another problem is, whenever I call the methods from Smart_campusBaseModuleApplicationModule, there is a System.NullReferenceException: Object reference not set to an instance of an object error. It's because the parametered constructor of the AppService is not being initiated. That is, I'm using the 'InserAsync' function of 'IRepository' interface in the AppService. I've coded to set an instance of the IRepository to _subjectRepository in the AppService Constructor. But that constructor is not getting initiated. So that, an error is occurred at the point of inserting the data. Code: Topscore.Smart_campus.BaseModule.Application

public class SubjectAppService : Smart_campusAppServiceBase, ISubjectAppService
    {
        public readonly IRepository<Subject> _subjectRepository;

        public SubjectAppService()
        {

        }
        public SubjectAppService(IRepository<Subject> subjectAppService)
        {
            _subjectRepository = subjectAppService;
        }

        public ListResultDto<SubjectListDto> GetSubjects()
        {
            return new ListResultDto<SubjectListDto>(
                _subjectRepository.GetAll()
                    .OrderBy(t => t.Name)
                    .MapTo<List<SubjectListDto>>()
                );
        }

index.js

vm.getSubjects = function () {
                vm.loading = true;
                subjectService.getSubjects()
                    .then(function (result) {
                        vm.userGridOptions.totalItems = result.data.totalCount;
                        vm.userGridOptions.data = result.data.items;
                    }).finally(function () {
                        vm.loading = false;
                    });
            };

When the GetSubjects methode is invoked from the API, it comes to the parameterless constructor of the AppService. Then it comes to the method, not to the parametered constructor. Hence the error is occurred.

I've tried after removing the parameterless constructor. At that time, the code doesn't even coming to the SubjectAppService :roll: It just showing 'An error has occurred! Error detail not sent by server.' in the browser. (NB: Configuration.Modules.AbpWebCommon().SendAllExceptionsToClients is set to true :|) I couldn't find any details of the error in AbpAuditLogs or Logs.txt.

How can we make it possible?? Please help me on this too..

Showing 31 to 33 of 33 entries