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

Activities of "trisledinh"

Can you help me?

Hi,

I have added new custom repository to implement EF6 of Oracle Database. But when call application services from client, throwing server error

"An exception of type 'Castle.MicroKernel.ComponentNotFoundException' occurred in Castle.Windsor.dll but was not handled in user code. Additional information: No component for supporting the service ModuleZeroSampleProject.Enterprises.UploadingEntities was found"

It mean that ModuleZeroSampleProject.Enterprises.UploadingEntities was not registered assembly when implement Dependency Injection Pattern. But I don't know when registered this dbcontext class. I did as the following:

Step 1: Install ODTwithODAC from oracle Step 2: Install Oracle EF6 from Nuget Package Console Step 3: Add EntityDataModel to Core project (generate code from database) Step 4: Add RepositoryBase Class into Entity Framework Project such as

namespace ModuleZeroSampleProject.EntityFramework.Repositories
{
    public class UploadingRepositoryBase<TEntity, TPrimaryKey> : EfRepositoryBase<UploadingEntities, TEntity, TPrimaryKey>
    where TEntity : class, IEntity<TPrimaryKey>
    {
        public UploadingRepositoryBase(IDbContextProvider<UploadingEntities> dbContextProvider)
            : base(dbContextProvider)
        {
        }

        //add common methods for all repositories
    }

    //A shortcut for entities those have integer Id
    public class UploadingRepositoryBase<TEntity> : UploadingRepositoryBase<TEntity, int>
        where TEntity : class, IEntity<int>
    {
        public UploadingRepositoryBase(IDbContextProvider<UploadingEntities> dbContextProvider)
            : base(dbContextProvider)
        {
        }

        //do not add any method here, add to the class above (because this class inherits it)
    }
}

Step 5: Add IUploadingRepository to Core Project

namespace ModuleZeroSampleProject.Enterprises
{
    public interface IUploadingRepository : IRepository<CV_ENTERPRISE, int>
    {
        List<CV_ENTERPRISE> GetEnterprise(int? enterpriseId);
    }
}

Step 6: Add UploadingRepository to EntityFramework Project Step 7: Add IUploadingService and UploadingServices to ApplicationModule Project Step 8: Modify client to get method from Uploading Services.

All thing was built successfully, run OK. But when call get method from Uploading Services, throwing error not registered assembly.

Can you help me?

Thank you very much.

Thank you!

I tried a multi-level menu navigation which has child menus but it seems child menu is not working. I implemented it with single page and multi page template, but it is not successful. How to fix it?

And also I have some other questions:

  • How to integrate with Oracle Database?
  • How to call Stored Procedure from Repository?

I hope you have free time to help me. Thank you very much.

Yes,

I developed from ModuleZeroTemplate. I have fixed it by run updating database in Package Console Manager to synchonize entity object with table in database. Now, I can define step to step:

Step 1: Create new entity class in Project Core Step 2: Add Entity to DbContext Step 3: Run command in Package Console Manager as the following: Add-Migration entity_name --> to add new migration file Update-Database -Verbose --> to add table in database Step 4: Add interface and class in Application Services Layer Step 5: Add new menu in NavigationProvider Step 6: Add html and js file in Presentation Layer Step 7: Start customization

Thank a lot. I am implementing registration account feature and sending email. Dear Hikalkan, have you recommendation about this feature?

Thank your very much.

Hi,

Thank you very much.

I will try to using T4 Template for generation. Today, I try to implement Domain, Application Service but there is one error showing as:

Can't create component 'ModuleZeroSampleProject.Uploading.UpAttachAppService' as it has dependencies to be satisfied. 'ModuleZeroSampleProject.Uploading.UpAttachAppService' is waiting for the following dependencies:\r\n- Service 'Abp.Domain.Repositories.IRepository`1[[ModuleZeroSampleProject.Uploading.UpAttach, ModuleZeroSampleProject.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered.

Steps which I did:

  • Add UpAttach.cs in Core Project (ex: public class UpAttach : CreationAuditedEntity<int, User>)

  • Add interface IUpAttachServices.cs in Application Project (ex: public interface IUpAttachAppService : IApplicationService);

  • Add implement class UpAttachServices.cs in ApplicationServices (ex:

[AbpAuthorize]
    public class UpAttachAppService : ApplicationService, IUpAttachAppService
    {
        private readonly IRepository&lt;UpAttach&gt; _attachRepository;
        private readonly IRepository&lt;User, long&gt; _userRepository;
        private readonly IUnitOfWorkManager _unitOfWorkManager;

        public UpAttachAppService(IRepository&lt;UpAttach&gt; attachRepository, IRepository&lt;User, long&gt; userRepository, IUnitOfWorkManager unitOfWorkManager)
        {
            _attachRepository = attachRepository;
            _userRepository = userRepository;
            _unitOfWorkManager = unitOfWorkManager;
        }

        public PagedResultOutput&lt;AttachDto&gt; GetAttachs(GetQuestionsInput input)
        {
            if (input.MaxResultCount &lt;= 0)
            {
                input.MaxResultCount = SettingManager.GetSettingValue&lt;int&gt;(MySettingProvider.QuestionsDefaultPageSize);
            }

            var questionCount = _attachRepository.Count();
            var questions =
                _attachRepository
                    .GetAll()
                    .Include(q => q.CreatorUser)
                    .OrderBy(input.Sorting)
                    .PageBy(input)
                    .ToList();

            return new PagedResultOutput&lt;AttachDto&gt;
                   {
                       TotalCount = questionCount,
                       Items = questions.MapTo&lt;List&lt;AttachDto&gt;>()
                   };
        }

    }

)

But when I compose from Fiddle2 with URL "http://localhost:6242/api/services/app/upAttach/GetAttachs", the error was shown. I try to clarify it but not successful.

Can you help me?

Thank a lot!

Firstly, I really like your idea and workload to make asp.net Boilerplate community. I like boilerplate. I am starting use Boilerplate to make our stable framework for building enterprise application. At the moment, I have some question:

How to generate Domain Layer (Entities, Respository, DbContext, DTO)? Using ADO.NET Entity Data Model or write your self? How to generate Application Services Layer?

With project which has many table, we would like to generate Domain Layer and Application Services Layer automatically to save resources.

Can you help me?

Thank you very much.

Showing 1 to 6 of 6 entries